Click here to Skip to main content
16,007,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange compile error Pin
ns16-Jan-03 6:08
ns16-Jan-03 6:08 
GeneralRe: Strange compile error Pin
jmkhael16-Jan-03 6:14
jmkhael16-Jan-03 6:14 
GeneralRe: Strange compile error Pin
Chris Richardson16-Jan-03 8:03
Chris Richardson16-Jan-03 8:03 
GeneralRe: Strange compile error Pin
ns16-Jan-03 8:09
ns16-Jan-03 8:09 
GeneralRe: Strange compile error Pin
ns16-Jan-03 9:09
ns16-Jan-03 9:09 
GeneralRe: Strange compile error Pin
Chris Richardson16-Jan-03 9:19
Chris Richardson16-Jan-03 9:19 
GeneralRe: Strange compile error Pin
ns16-Jan-03 9:31
ns16-Jan-03 9:31 
GeneralRe: Strange compile error Pin
Chris Richardson16-Jan-03 9:35
Chris Richardson16-Jan-03 9:35 
ns wrote:
I didnt put the doc.h before the view.h include

Uh oh Wink | ;)

Yeah, the order is very important. The preprocessor transforms the source file and all it's included files (minus #ifndef'd out sections etc) into one big file (not sure on the actual storage of it), then the compiler compiles that. So if you don't include doc.h before the view class, this is what the compiler sees:

class CYourView : public CView
{
...
   // Uh oh, "what's CYourDoc?" says the compiler.
   CYourDoc * GetDocument();
};

class CYourDoc : public CDocument
{
...
};


And that's what caused your problems. Glad to hear that you fixed it!

Chris Richardson

Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
GeneralProcess's virtual address Pin
Anonymous16-Jan-03 5:06
Anonymous16-Jan-03 5:06 
GeneralRe: Process's virtual address Pin
AlexO16-Jan-03 5:35
AlexO16-Jan-03 5:35 
GeneralRe: Process's virtual address Pin
Wenrich17-Jan-03 5:03
Wenrich17-Jan-03 5:03 
QuestionHow can i draw in a CDialog Pin
willempipi16-Jan-03 4:32
willempipi16-Jan-03 4:32 
AnswerRe: How can i draw in a CDialog Pin
Alvaro Mendez16-Jan-03 4:38
Alvaro Mendez16-Jan-03 4:38 
GeneralRe: How can i draw in a CDialog Pin
Joaquín M López Muñoz16-Jan-03 6:01
Joaquín M López Muñoz16-Jan-03 6:01 
QuestionHooking Question. Am I Dumb? Pin
RickGavin16-Jan-03 4:17
RickGavin16-Jan-03 4:17 
AnswerRe: Hooking Question. Am I Dumb? Pin
jmkhael16-Jan-03 6:06
jmkhael16-Jan-03 6:06 
GeneralBitmap and dialogbar Pin
MemLeak16-Jan-03 3:09
MemLeak16-Jan-03 3:09 
Generallocation of #include statements Pin
ns16-Jan-03 3:05
ns16-Jan-03 3:05 
GeneralRe: location of #include statements Pin
Maximilien16-Jan-03 3:11
Maximilien16-Jan-03 3:11 
GeneralRe: location of #include statements Pin
ns16-Jan-03 3:15
ns16-Jan-03 3:15 
GeneralRe: location of #include statements Pin
blackmesa16-Jan-03 7:29
blackmesa16-Jan-03 7:29 
GeneralRe: location of #include statements Pin
Maximilien16-Jan-03 8:31
Maximilien16-Jan-03 8:31 
GeneralRendering HTML Pin
Jamie Hale16-Jan-03 2:53
Jamie Hale16-Jan-03 2:53 
GeneralRe: Rendering HTML Pin
Joel Lucsy16-Jan-03 3:19
Joel Lucsy16-Jan-03 3:19 
GeneralRe: Rendering HTML Pin
Jamie Hale16-Jan-03 3:32
Jamie Hale16-Jan-03 3:32 

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.