Click here to Skip to main content
15,911,890 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMFC - SetDlgItemText() Pin
14-Dec-01 11:24
suss14-Dec-01 11:24 
GeneralRe: MFC - SetDlgItemText() Pin
Christian Graus14-Dec-01 11:30
protectorChristian Graus14-Dec-01 11:30 
GeneralRe: MFC - SetDlgItemText() Pin
Michael Dunn14-Dec-01 17:23
sitebuilderMichael Dunn14-Dec-01 17:23 
GeneralRe: MFC - SetDlgItemText() Pin
Carlos Antollini14-Dec-01 11:32
Carlos Antollini14-Dec-01 11:32 
GeneralRe: MFC - SetDlgItemText() Pin
Michael Dunn14-Dec-01 13:30
sitebuilderMichael Dunn14-Dec-01 13:30 
QuestionHow to get a pointer to an instance of a class... Pin
Sprudling14-Dec-01 11:15
Sprudling14-Dec-01 11:15 
AnswerRe: How to get a pointer to an instance of a class... Pin
Prem Kumar14-Dec-01 13:41
Prem Kumar14-Dec-01 13:41 
AnswerRe: How to get a pointer to an instance of a class... Pin
Erik Funkenbusch15-Dec-01 5:00
Erik Funkenbusch15-Dec-01 5:00 
Well, trying to copy MFC is fraught with danger and intrigue.

MFC tends to do a lot of monkey business behind the scenes. For instance, quite often, instead of calling new, MFC will allocate memory for an object, then call the objects constructor manually. I guess it makes sense if you consider that MFC came from DOS originally, over 10 years ago.

Anyways, how MFC does this is hidden in the constructor for CWinApp. In there, They do a few things, such as a module state variable = this (this being the CWinApp object) and doing some asserts that will assert if you try to create more than one instance.

This isn't the best way to do this, however. The better way would be to make your MyFrameWorkApp a singleton object, which makes it impossible to create more than one instance. If you don't know what a singleton is, I suggest doing some web searches on it, or buying the most excellent book "Design Patterns".

The reason you can't single-step into this is that the CWinApp's constructor get's called *BEFORE* WinMain. You have to put a breakpoint in CWinApp's constructor before you execute the app.


--
Where are we going? And why am I in this handbasket?
GeneralTimer stuff Pin
Rickard Andersson2014-Dec-01 9:46
Rickard Andersson2014-Dec-01 9:46 
GeneralRe: Timer stuff Pin
Christian Graus14-Dec-01 10:26
protectorChristian Graus14-Dec-01 10:26 
GeneralRe: Timer stuff Pin
Rickard Andersson2014-Dec-01 10:59
Rickard Andersson2014-Dec-01 10:59 
GeneralRe: Timer stuff Pin
Christian Graus14-Dec-01 11:28
protectorChristian Graus14-Dec-01 11:28 
GeneralRe: Timer stuff Pin
Rickard Andersson2015-Dec-01 1:10
Rickard Andersson2015-Dec-01 1:10 
GeneralPotentially silly question about CWinThread Pin
nay14-Dec-01 8:45
nay14-Dec-01 8:45 
GeneralRe: Potentially silly question about CWinThread Pin
Alvaro Mendez14-Dec-01 10:52
Alvaro Mendez14-Dec-01 10:52 
GeneralRe: Potentially silly question about CWinThread Pin
nay14-Dec-01 12:09
nay14-Dec-01 12:09 
QuestionWhat am I missing here? Pin
clintsinger14-Dec-01 7:25
clintsinger14-Dec-01 7:25 
AnswerRe: What am I missing here? Pin
Joaquín M López Muñoz14-Dec-01 10:33
Joaquín M López Muñoz14-Dec-01 10:33 
Generalaccessing an ADO recordset pointer from another window Pin
14-Dec-01 7:13
suss14-Dec-01 7:13 
GeneralRe: accessing an ADO recordset pointer from another window Pin
Carlos Antollini14-Dec-01 7:28
Carlos Antollini14-Dec-01 7:28 
QuestionHow to find out unwanted DLL in a System? Pin
14-Dec-01 6:38
suss14-Dec-01 6:38 
AnswerRe: How to find out unwanted DLL in a System? Pin
Alvaro Mendez14-Dec-01 7:16
Alvaro Mendez14-Dec-01 7:16 
GeneralTrying to manipulate CStdioFile Pin
Stevieslu14-Dec-01 6:37
Stevieslu14-Dec-01 6:37 
GeneralRe: Trying to manipulate CStdioFile Pin
Alvaro Mendez14-Dec-01 7:19
Alvaro Mendez14-Dec-01 7:19 
Generalimplementing powerpoint presentation slide show Pin
Kuniva14-Dec-01 5:37
Kuniva14-Dec-01 5:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.