如何在vc++中调用vc++ dll。
在 .h 文件中
typedef int (*LPVAR)(char * ptr_f, char *CC);
HINSTANCE hDLL;
在 .cpp 文件中
hDLL = NULL;
LPVAR var;
hDLL = LoadLibrary("Pro.dll");
if( hDLL == NULL )
AfxMessageBox("Could not load the DLL");
else
{
var = (LPVAR)GetProcAddress(hDLL, "#2"); //2 is ordinal no
char *ch,*a;
ch = (char*)malloc(100*sizeof(char));
a = (char*)malloc(10*sizeof(char));
int c = var(ch,a);
}