Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execution after DoModal()

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Nov 23, 2003
249
US
How do I call a function when a dialog is initialized?
The main dialog has InitInstance and if I call the function from within the main it crashes (works perfectly inside it's own dialog).

-Ron

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
what version of VisualStudio do you have?

Ion Filipski
1c.bmp
 
Have .Net 2001(?) and in a couple days I will have 2003

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
in this case you should override the function OnCreate. If yu need something to do when application starts, put this code in function _tmain or _tWinMain.

Ion Filipski
1c.bmp
 
How would I got about doing that?

The OnCreate function has LPCREATESTRUCT lpCreateStruct, what is this and what do I need to point it to?

-Ron

/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
 
You should put there nothing. It is a handler, and the LPCREATESTRUCT is passed to you. You don't call OnCreate

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top