Sunday, 8 September 2013

retrieving a char* parameter from a C DLL

retrieving a char* parameter from a C DLL

I have some problem of converting a C code in VB using a DLL.
My VB6 code
Private Declare Function decode Lib "project.dll" ( _
ByVal status As String, _
ByVal Data As String) As Long
Const CDATA = 50
Private Sub Command2_Click()
Dim retour_decode As Long
Datadec = String$(CDATA + 1, 0)
buffer = String$(4 + 1, 0)
retour_decode = decode( buffer, Datadec)
Datadec = Left$(Datadec, InStr(Datadec, Chr$(0)) - 1)
buffer = Left$(buffer, InStr(buffer, Chr$(0)) - 1)
please how can I put "xx" on the buffer like this instruction in C:
strcpy(buffer, "xx");
it's true to write :
buffer = String$(4 + 1, xx)
please any ideas, any proposals or corrections.
please help me.

No comments:

Post a Comment