Hi

I am attempting to create a 64 bit win32 test application that loads a 64 bit MFC test DLL. I created a test function within the DLL that takes in a pointer to an integer. This function is an exported DLL function. I load the DLL in the win32 executable. I get access to the exported function. I call the DLL test function, sending it a pointer to an integer where the value is = to 100. I then step into the DLL test function using the debugger. Within the DLL test function the address of the integer pointer is undefined or NULL. So the pointer was not passed properly. Now, if I rebuild the application and the DLL using the 32 bit compilers then all problems go away. The integer pointer is passed without any issues into the DLL test function and I can see the value (100).

Any ideas would be greatly appreciated.
thanks


Here is my code for the win32 application:



typedef void (CALLBACK* D_TestDllTest)(int* Val);

.
.
.

int APIENTRY _tWinMain(HINSTANCE hInstance,...)
{

.
.
.

// load "TestDLL.dll"
CString Path = "c:\\TestDll.dll";
HINSTANCE TestDllHInst = AfxLoadLibrary((LPCTSTR)Path);

// get pointer to exported DLL function
D_TestDllTest TestDllTest = (D_TestDllTest)GetProcAddress(TestDllHInst, "TestDllTest");

// call the DLL function
int Val = 100;
TestDllTest(&Val);

.
.
.

}



Here is the DLL code:


void CTestDllApp::TestDllTest(int* Val)
{

*Val = 2;

return;
}