兄弟我用DELPHI5开发了一个动态连接库,其中输入、输出参数为PCHAR类型,
在使用VC来调用时,有些问题,请问VC中使用什么类型的参数。请各位帮忙调试。我的程序是这样的,请指教
DELPHI中
  function test(var teststr: PChar):integer;stdcall;function test(var teststr: PChar):integer;
begin
  Result := 0;
  StrPCopy(teststr,'aaaaaaaa');
end;VC
typedef int (__stdcall * pTest)(char *szStr);  HINSTANCE hLibrary;
pTest Test;
hLibrary=LoadLibrary("test.dll");
if(!hLibrary)
{
AfxMessageBox("can't open dll file");
return;
}
Test=(pTest)GetProcAddress(hLibrary,"test");
char buffer[100];
int a= (*Test)(buffer);  //此处出错
CString s=buffer;
    AfxMessageBox(s);
FreeLibrary(hLibrary);错误信息为:
Unhandled exception in dlltest.exe(test.dll):0xC0000005:Access Violation