Send message from view to CMainFrame

Hi,

I'm wanting to do some processing within my app after the view has been drawn. Can I send a message to my CMainFrame class from the OnDraw() method within my View class?

The code that I want to use is in CMainFrame so I want to call that code but only after the app is up and running and the initial view has been drawn.

Anyone help would be much appreciated. Thanks.
In principle you can throw in a SendMessage() in the painting procedure. Have you tried it?

And I'll go ahead and give you a warning: SendMessage() will delay processing of the WM_PAINT message if both windows belong to the same thread. Instead use PostMessage(). But other than that...
Thanks webJose,

I put the following code into my View's OnDraw method:

static BOOL triedConnecting = FALSE;

if (!triedConnecting)
{
PostMessage(ZM_CONNECTIFREQUIRED,0,0);
triedConnecting = TRUE;
}

and manually added the following to the CMainFrame message map:

ON_MESSAGE(ZM_CONNECTIFREQUIRED,OnConnectIfCommandLineIPAddressExists)

with the appropriate method added to my code.

Looks like the right thing to do but my new method is not being called even though the message is being posted. Is there something I'm missing here? I'm using Visual Studio 2008 btw.
Not sure. I don't do or know MFC. You could be missing some connecting MFC code, but I'm not the guy to ask about it.
Topic archived. No new replies allowed.