My new method OnConnectIfCommandLineIPAddressExists() is not being called even the PostMessage is. Am I missing something? Is there something else I should be doing?
I will need to test and confirm this but:
If you used Postmessage in the View's onDraw method - wouldn't the view be posting the message to itself and not to the CMainFrame parent??
guestgulkan is probably right. You must have the HWND of the window you need to send the message to. If you wanted something more impersonal, there is PostThreadMessage(), but that message is posted without a window handle, meaning it must be processed at the message pump.
So yes, you must direct the message to the appropriate window.
To get the messge to the CmainFrame, I changed the postmessage to this and it worked ok:
1 2 3 4 5 6
if (!triedConnecting)
{
::PostMessage( GetParent()->m_hWnd, ZM_CONNECTIFREQUIRED,0,0); //using global (standard) windows message passing function
triedConnecting = TRUE;
}
Thanks, I tried it but couldn't get it to work for me. Still had the same problem. Spent too much time trying to get this to work so I'm trying a completely different approach. Thanks anyway.