I have a dynamic link library code that I created with C ++, like this
char* _stdcall encrypt(char *plaintext, char *key);
library name is ttvc.
this is the content of the *.def file
LIBRARY ttvc
EXPORTS
encrypt @1
I try to call this function from the vb code
Public Declare Function Lock Lib "ttvc.dll" Alias "encrypt"(ByVal plain as String, ByVal key As String)As String
and delphi code
function encrypt(plain:String;key:String;):PChar;stdcall;external 'TTVC.dll';
My code is working fine.
But I was confused, what is the difference between the string data types in Visual Basic, Delphi, and C++?
What is the difference between
- String in VB
- char* in C++
- String in delphi
- PChar in delphi
How can delphi and VB send strings to the library? How can the library receive strings from different programming languages and different data types?