Re: Automatically run procedure after starting SDI Application
You can do this sort of thing (and anything else with the window or
controls) in the OnInitDialog() function as Jonathan suggested, or you could
set a timer (in that same routine) that would fire the button for you (by
calling the handling routine for the button).
Tom
"Jen" <leonard522@aol.com> wrote in message
news:1154567448.987110.317550@75g2000cwc.googlegroups.com...
Hi ~
I have an SDI Application. I want to start the program, and then
without needing the user to interact, have a button get pressed on the
form. This button calls a procedure that will run. Then I want the
program to exit.
I have tried calling my button from the Views OnCreate function, but
that is too early, and the view isn't displayed yet. Like this:
int CMyView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CRecordView::OnCreate(lpCreateStruct) == -1)
return -1;
OnImport(); //Call my function
return 0;
}
Any ideas? I really appreciate it!! Thanks ~
Jen