M
Mayur
Hello All
I am able to call the function exported by Exe from a dll file
im getting the address of the function but whille calling that function im
getting access violation Error as bellow my code
Function Exported by EXE
void __declspec(dllexport) ExeFn()
{
MessageBox(NULL,"hi","From Exe",MB_OK);
}
Function call from Dll
HMODULE hModule;
LPTSTR modname;
hModule=GetModuleHandle("Placeholder.exe");
if (hModule == NULL)
{
hModule=(HMODULE)LoadLibrary ("Placeholder.exe");
}
FnPtrT FnPtr = (FnPtrT)::GetProcAddress((HMODULE)hModule, "ExeFn");
if(FnPtr)
{
MessageBox(NULL,(LPCTSTR)FnPtr,"Exec",MB_OK);
(*FnPtr)();
}
Followinf Error
Unhandled exception at 0xfffffff9 in Mayur.dll 0xC0000005: Access violation
reading location 0xfffffff9.
I am able to call the function exported by Exe from a dll file
im getting the address of the function but whille calling that function im
getting access violation Error as bellow my code
Function Exported by EXE
void __declspec(dllexport) ExeFn()
{
MessageBox(NULL,"hi","From Exe",MB_OK);
}
Function call from Dll
HMODULE hModule;
LPTSTR modname;
hModule=GetModuleHandle("Placeholder.exe");
if (hModule == NULL)
{
hModule=(HMODULE)LoadLibrary ("Placeholder.exe");
}
FnPtrT FnPtr = (FnPtrT)::GetProcAddress((HMODULE)hModule, "ExeFn");
if(FnPtr)
{
MessageBox(NULL,(LPCTSTR)FnPtr,"Exec",MB_OK);
(*FnPtr)();
}
Followinf Error
Unhandled exception at 0xfffffff9 in Mayur.dll 0xC0000005: Access violation
reading location 0xfffffff9.