The company wants to use vb.net to call Hkust's voice synthesizer interface
The first is to write their own tts_sample demo, but because C + + and vb.net data structure is not the same, so gave up the custom demo this method
So simply take that demo as DLL file call interface on the line
In fact, my DLL is written in C, read a lot of examples on the internet just understand
__declspec (dllexport) int add ();
This method can generate DLL files
However, there are many problems with vb.net calls
Like what:
Garbled when passing in strings
The reason may be that the managed PInvoke signature does not match the unmanaged target signature
The entry point cannot be found
Wait
Public Declare Function add Lib "Edr.dll" (ByVal params as String) as Integer
You need to use the int __stdcall keyword in C + + and you need a def file to use the Declare method
Use the DllImport method to use __declspec (dllexport) in C + + without def files
Here I use the Declare method
C + + function definition
int __stdcall Add (const char* login_params)
def file definition
LIBRARY EDR
Exports
Add @ 1
vb.net function call
Public Declare Function Add Lib "Edr.dll" (ByVal Login_params as String) as Integer
Passing parameters by using the ByVal method