Click here to Skip to main content
15,913,758 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMemory Leak Pin
William Bartholomew15-May-01 13:03
William Bartholomew15-May-01 13:03 
GeneralRe: Memory Leak Pin
Gerald Schwab15-May-01 16:18
Gerald Schwab15-May-01 16:18 
GeneralRe: Memory Leak Pin
Michael Dunn15-May-01 16:25
sitebuilderMichael Dunn15-May-01 16:25 
GeneralRe: Memory Leak Pin
15-May-01 23:48
suss15-May-01 23:48 
GeneralRe: Memory Leak Pin
15-May-01 23:48
suss15-May-01 23:48 
GeneralWhere to put header files Pin
Christopher15-May-01 12:18
Christopher15-May-01 12:18 
GeneralRe: Where to put header files Pin
Christian Graus15-May-01 12:52
protectorChristian Graus15-May-01 12:52 
GeneralRe: Where to put header files Pin
Tim Deveaux15-May-01 13:45
Tim Deveaux15-May-01 13:45 
This is something I wish someone would write an article on - with an aim of avoiding having to nest header includes in MFC projects. The problem arises as translation units include headers you're not expecting them to, and a nice directed include graph of an MFC app would be a boon.

But here's a tip that might help - if you add a new class, include its header in the cpp file that holds the application class (MyApp.cpp) right after stdafx.h. Then, include it in whatever .cpp file will be using it, before the header for that file.

The application class is typically the first translation unit to get compiled in these projects, and often the scope of its includes (doc and view, e.g.) are what cause the kaffufle.

later...
Actually, on reading your message again, you might be able to just get by with a forward declation of the form class at the top of the header, since you are just declaring a pointer.

----
"If you would see the invisible, you must look carefully at the visible."
Santayana
GeneralStarting another application from code Pin
15-May-01 11:14
suss15-May-01 11:14 
GeneralRe: Starting another application from code Pin
Christian Graus15-May-01 11:18
protectorChristian Graus15-May-01 11:18 
GeneralChange view in OnNewDocument Pin
Clinton James15-May-01 9:28
Clinton James15-May-01 9:28 
GeneralRe: Change view in OnNewDocument Pin
Tomasz Sowinski15-May-01 10:00
Tomasz Sowinski15-May-01 10:00 
GeneralRe: Change view in OnNewDocument Pin
Clinton James16-May-01 4:45
Clinton James16-May-01 4:45 
Generalneed one example Pin
15-May-01 9:00
suss15-May-01 9:00 
GeneralRe: need one example Pin
Christian Graus15-May-01 22:57
protectorChristian Graus15-May-01 22:57 
GeneralCScrollView question Pin
Richard Cheng15-May-01 8:19
Richard Cheng15-May-01 8:19 
GeneralError message??!!!!! Pin
Richard Cheng15-May-01 7:41
Richard Cheng15-May-01 7:41 
GeneralRe: Error message??!!!!! Pin
Tomasz Sowinski15-May-01 7:54
Tomasz Sowinski15-May-01 7:54 
GeneralRe: Error message??!!!!! Pin
Richard Cheng15-May-01 8:12
Richard Cheng15-May-01 8:12 
GeneralDialog vs MDI Pin
mr200315-May-01 6:50
mr200315-May-01 6:50 
GeneralRe: Dialog vs MDI Pin
15-May-01 21:36
suss15-May-01 21:36 
Questionhow to clear a listbox control Pin
15-May-01 5:39
suss15-May-01 5:39 
AnswerRe: how to clear a listbox control Pin
15-May-01 6:44
suss15-May-01 6:44 
AnswerRe: how to clear a listbox control Pin
Gunnar Mätzler15-May-01 21:05
Gunnar Mätzler15-May-01 21:05 
GeneralOnOpenDocument Pin
15-May-01 5:23
suss15-May-01 5:23 

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.