How to trace the VC++.dll code from VC++.exe
Hi all,
I have a vc++.dll with each function defined as
extern "C" WINAPI EXPORT test(int i)
{
}
I have to write a vc++.exe to to call this function.
so i have written a VC++.exe(dialog based) as below:
//declare a callback function for the test API in .dll
typedef int (CALLBACK* LPFNMLTPLY)(int);
Added a button test in a dialog and when u click it it executes the
following code
void CDynamicLoadDlg::Ontest()
{
UpdateData();
CHAR szTemp [100]; // for storing error code & message
HINSTANCE hClcltr=LoadLibrary("nameofdll.dll"); //Loading dll into
calling processaddress
LPFNMLTPLY lpfnMuliply; // see top of file for its defination
if (hClcltr) //If DefExported.dll loded
{
lpfnMuliply = (LPFNMLTPLY)GetProcAddress(hClcltr,"test");
if (lpfnMuliply) //If Multiply functin found and get its address
{
m_ParOne=1;
m_Rslt=lpfnMuliply(m_ParOne);
UpdateData(FALSE);
}
else
{
wsprintf (szTemp, "GetProcAddress failed. \nError code: %d",
GetLastError());
MessageBox(szTemp); //Show why GetProcAddress failed?
}
FreeLibrary( hClcltr );
}
else
{
wsprintf (szTemp, "LoadLibrary failed. \nError code: %d",
GetLastError());
MessageBox(szTemp); //Show why LoadLibrary failed?
}
}
I am able to call the .dll function but the problem is i am not able
to trace the .dll code.Is my vc++.exe is correct.
Can anyone tell me what settings i have to do so that i can trace the
vc++.dll code
Thanks in advance,
Nithin