Not a duplicate of the suggested question, because I know how to call the functions and everything works fine. My question is about identifying/declaring the property in the VB6 code and not trying to get it to work.
I wrote a small library in C#, compiled for COM visibility/use, etc. All is well, I can use it in VB6 no sweat. I declared the functions in VB6, again, all is well. But I have a property in the library that I just don't know how to declare it in VB6.
I can use it just fine, but how do I actually declare it? I don't even know if this would be the correct terminology.
The library has 3 methods and 1 property. Methods are CreateHash, Encrypt, Decrypt. The property is Salt.
Everything is fully working, I just don't know how to show that the property exists and that it's for the library.
Some VB6 code (minus the commenting character for syntax highlighting):
Private Declare Function CreateHash Lib "CryptoLibrary.dll" (plainText As String) As String
Private Declare Function Encrypt Lib "CryptoLibrary.dll" (plainText As String, key As String) As String
Private Declare Function Decrypt Lib "CryptoLibrary.dll" (cipher As String, key As String) As String
//Somehow show that the Salt property exists
Private Sub Form_Load()
Dim c As New Crypto
Dim textToHash As String
Dim textToEncrypt As String
Dim encryptionKey As String
textToHash = "hash this text"
textToEncrypt = "encrypt this text"
encryptionKey = "ThisIsTheKey"
c.Salt = "SomeSalt" //works, but how do I "declare" it?
Dim hash As String
hash = c.CreateHash(textToHash)
Debug.Print "hash: " & hash
Dim cipher As String
cipher = c.Encrypt(textToEncrypt, encryptionKey)
Debug.Print "cipher: " & cipher
Dim plainText As String
plainText = c.Decrypt(cipher, encryptionKey)
Debug.Print "plainText: " & plainText
End Sub
EDIT: Showing the output from the debug window, to show that it works perfectly fine and that's not what this question is about. Again, the library is working in VB6 just fine.
hash: 09umCBt/Fx7F+kaHGCsmnAtG53p4YRrSaBgtiowkW0A= cipher: gJcImw14MOvqyGK/ToHMhnzgnigzAaeVylcrldvRBdFz+Gg5VGayhsAGogrYz8RT plainText: encrypt this text