K kazema Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-15 #2 假如有一个delphi的dll为dllex01.dll;它的一个导出函数为function test(strCHAR)CHAR; 在cb里这样调用: void __fastcall TForm1::Button1Click(TObject *Sender) { void* hd; char* str; hd = LoadLibrary("dllex01.dll");//获得DLL句柄 char* (*pf)(char*); if(hd!=0) pf = (char*(*)(char*))GetProcAddress(hd,"test"); //获得导出函数地址 if(pf!=NULL) str = pf("abc"); MessageBox(NULL,str,str,0); }
假如有一个delphi的dll为dllex01.dll;它的一个导出函数为function test(strCHAR)CHAR; 在cb里这样调用: void __fastcall TForm1::Button1Click(TObject *Sender) { void* hd; char* str; hd = LoadLibrary("dllex01.dll");//获得DLL句柄 char* (*pf)(char*); if(hd!=0) pf = (char*(*)(char*))GetProcAddress(hd,"test"); //获得导出函数地址 if(pf!=NULL) str = pf("abc"); MessageBox(NULL,str,str,0); }