I am currently porting a lot of code from an MFC-based application to a DLL for client branding purposes.
I've come across an unusual problem. This bit of code is the same in both systems:
// ...
CCommsProperties props;
pController->GetProperties( props );
if (props.handshake != HANDSHAKE_RTS_CTS)
{
props.handshake = HANDSHAKE_RTS_CTS;
pController->RefreshCommProperties( props );
}
// ... in another file:
void CControllerSI::RefreshCommProperties ( const CCommsProperties& props )
{
// ... code ...
}
CommProperties is a wrapper for the comm settings, serialization of etc. and pController is of type ControllerSI which itself is a layer between the actual Comms and the Application.
On the original MFC version the setting of handshake to RTS-CTS sticks but when running as the DLL version it resets itself to 0 as soon as the function is entered. The code is contained entirely in the DLL section of the code, so there are no boundaries.
The main differences between the original and the new modules is the variables that call the various dialogs have been removed and the removed #includes
I've lost an afternoon to this and I don't really want to lose any more...