Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass parameter
Message
 
To
11/09/2000 22:23:19
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00415234
Message ID:
00415332
Views:
14
>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;
>}


Try 2 things:
Private Decalre Function getpeopledata lib "mydll.dll" _
(ByVal port As Integer, ByVal mylen As Integer,<B>ByVal</B> Data As String) _
As Integer

<B>Call</B> getpeopledata(1, 10, Data)
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform