Why painting code? That is a really poor place for something like that.
OnIntialUpdate(). This way you don't even need a flag variable.
Otherwise PostMessage is a very good solution.
AliR.
"RAN" <nijenhuis@wish.nl> wrote in message
news:1187720799.182448.188520@19g2000hsx.googlegroups.com...
I want to show a modal dialog immediatly after my SDI formview app has
become visible. (at startup) (without having to press a button first).
I mean i want to show a login dialog immediatly after the app. becomes
active.
If i do DoModal() for the login dialog somewhere in my code like in
OnInitialUpdate(), the dialog appeares before the rest of the app is
visible.
Here's a real kludge:
Initialise a flag somewhere appropriate
BOOL bLaunchedDialogue(FALSE);
Then in your painting code:
if( !bLaunchedDialogue )
{
PostMessage( ....) // private message which causes dialogue to be
launched
bLaunchedDialogue = TRUE;
}
No, I don't like it either, but it should work :-)
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm