I want to call my vc++ dll in my vc++ code. but the error occur that Unhandled exception at 0x00000000 in .exe: 0xC0000005: Access violation reading location 0x00000000.
after last line.I have call vc++ dll by ordinal no.
In .h file
typedef int (*LPVAR)(char * ptr_f, char *CC);
In .cpp file
HINSTANCE hDLL;
hDLL = NULL;
LPVAR var;
hDLL = LoadLibrary("Prod.dll");
if( hDLL == NULL )
AfxMessageBox("Could not load the DLL");
/*int ordinal = 2;
HMODULE dll = LoadLibrary("Prod.dll");
FARPROC fn = GetProcAddress(dll, MAKEINTRESOURCE(ordinal));*/ //how to proceed after this.
else
{
var = (LPVAR)GetProcAddress(hDLL, "Ver_C");
char *ch,a;
ch = (char*)malloc(100*sizeof(char));
a = 'z';
int ans = var(ch,&a); //Unhandle exception after that.
}