I am running two 64 bit com dlls, BCRMaster.dll and BCRSlave.dll in a process of a larger 64 bit application. BCRSlave calls a function in BCRMaster called SlaveCheckin
where the instance of a Slave instance is logged along with it's DWORD pointer, DWORD ID and BOOL LiveOrDie which is to be 1 or 0 whether the slave is connecting or disconnecting.
If compiled to 32 bit and run in a 32 application this works flawlessly.
If compiled to 64 bit and run in a 64 bit version of the same app the wrong data is received at the master. I am using a .DEF file to do the exports.
It looks like the receiving DWORD is not wide enough. What should I be doning and is there a bitness independent solution?
Here is the slave calling code:
Collapse | Copy Code
typedef void (CALLBACK* LPFNDLLFUNC1)(DWORD,CBCRSlave*,BOOL);
HINSTANCE hDLL; LPFNDLLFUNC1 lpfnDllFunc1;
hDLL = LoadLibrary("BCRMaster");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL, "SlaveCheckin");
if (!lpfnDllFunc1)
{
FreeLibrary(hDLL);
return -1;
}
else
{
CurThisPtr = this;
lpfnDllFunc1(m_dwSurfaceId,CurThisPtr,1);
}
}
if ( FAILED( hr ))
return hr;
}
return hr;
}
---------------------------------------------------------------------------------
Here is the receiving Master function:
Collapse | Copy Code
void CBCRMaster::SlaveCheckin(DWORD SurfaceID, DWORD ObjInstPtr,BOOL BornOrDead)
----------------------------------------------------------------------------------
The Slave sends:
SurfaceID = 0x00000boc
ObjIstPtr = 0x000000000a9f7930
BornOrDead = 1
The Master Receives:
SurfaceID = 0x0b0c7930
ObjInstPtr = 0x00000001
BornOrDead = 0x0012e438
:Thanks
Ron