在dll中写的函数返回字符串,返回不了哪错了
dll中
int PASCAL getstr(LPCTSTR buf,int len)
{
buf = "dsfhdsafjkdsahfs";
return 1;
}
调用
typedef int (__stdcall *GetMaC)(CString buf,int len);
HINSTANCE hInst;
hInst = LoadLibrary("pbdwt60.dll");
if ( hInst != NULL )
{
CString s="";
CString s1="aaa";
int len=100;
GetMaC mGetMac = (GetMaC)GetProcAddress(hInst,"getstr");
if(mGetMac != NULL)
{
int i=mGetMac(s,len);//s没有返回
}
}