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; }