Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass parameter
Message
De
11/09/2000 08:10:13
 
 
À
Tous
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Titre:
Pass parameter
Divers
Thread ID:
00414811
Message ID:
00414811
Vues:
51
Hi,
I have the following function in dll. How should I pass the parameter for this function in VB? I try the following code but I get illegal operation. Any mistakes I do?

Thank you
Private Decalre Function getpeopledata lib "mydll.dll" _
(ByVal port As Integer, ByVal mylen As Integer,ByRef Data As String) _
As Integer

Dim Data as String
getpeopledata(1, 10, Data)

//C Dll
int _export _stdcall getpeopledata(int port,int len,char *data)
{
  int cmd;
  int c;
  char   tmp[30]="1234567890123456789012345678";

  strcpy(data,tmp);
  ...                    //do something here
  ...
  ...
  memcpy(data,st_data1,sizeof(st_data1));
  return 1;
}
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Répondre
Fil
Voir

Click here to load this message in the networking platform