Click here to Skip to main content
15,908,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to check whether a file is already open Pin
David Crow12-Mar-04 2:25
David Crow12-Mar-04 2:25 
AnswerRe: How to check whether a file is already open Pin
Garth J Lancaster12-Mar-04 12:14
professionalGarth J Lancaster12-Mar-04 12:14 
GeneralOpenGL texturing problem Pin
zeno8111-Mar-04 22:26
zeno8111-Mar-04 22:26 
GeneralSource code Prunning Pin
axid3j1al11-Mar-04 21:35
axid3j1al11-Mar-04 21:35 
GeneralRe: Source code Prunning Pin
Steve S12-Mar-04 0:25
Steve S12-Mar-04 0:25 
Generaldo you use new()?please instruct me! Pin
vividtang11-Mar-04 21:31
vividtang11-Mar-04 21:31 
GeneralRe: do you use new()?please instruct me! Pin
toxcct11-Mar-04 21:48
toxcct11-Mar-04 21:48 
GeneralRe: do you use new()?please instruct me! Pin
jhwurmbach11-Mar-04 22:15
jhwurmbach11-Mar-04 22:15 
vividtang wrote:
then i define "CChildFrame*p_ADD" in "MainFrm.h",

At this point, the CChildFrame-class is known to the compiler?
You either need to have the ChildFrame.h-file #include-ed in MainFrm.h, or you can, as you ar only declaring a pointer to the class, not an instance itself, write
class CChildFrame;
just below all includes, but before the class starts. This is called 'forward-declaration' and is the C++ way of telling the compiler: "Shut up, you will know that class when you really need it!".
But you have to keep that promise: When the compiler is asked to construct the instance of CChildFrame, in the new() statement, the class must be fully known. To achieve this, just write
#include "ChildFrame.h"
in MainFrame.cpp at the top. Best to put it after all other #includes.

This should then compile cleanly.




"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."

-- Caius Petronius, Roman Consul, 66 A.D.

GeneralRe: do you use new()?please instruct me! Pin
vividtang12-Mar-04 0:22
vividtang12-Mar-04 0:22 
GeneralRe: do you use new()?please instruct me! Pin
jhwurmbach12-Mar-04 0:24
jhwurmbach12-Mar-04 0:24 
GeneralRe: do you use new()?please instruct me! Pin
vividtang12-Mar-04 16:21
vividtang12-Mar-04 16:21 
GeneralRe: do you use new()?please instruct me! Pin
vividtang12-Mar-04 16:33
vividtang12-Mar-04 16:33 
GeneralTAPI Pin
chen_chen121211-Mar-04 20:51
chen_chen121211-Mar-04 20:51 
GeneralRe: TAPI Pin
Michael P Butler11-Mar-04 21:29
Michael P Butler11-Mar-04 21:29 
GeneralLanguage bar like app (IME) help pls Pin
Bagoj11-Mar-04 20:38
Bagoj11-Mar-04 20:38 
GeneralA question about asycfilt.dll Pin
Atif Mushtaq11-Mar-04 20:11
Atif Mushtaq11-Mar-04 20:11 
GeneralAccess Violation during Excel Automation Pin
Ajay Mudgal11-Mar-04 19:52
Ajay Mudgal11-Mar-04 19:52 
GeneralPlugin Frameworks Pin
Tarundeep Singh Kalra11-Mar-04 19:46
Tarundeep Singh Kalra11-Mar-04 19:46 
GeneralRe: Plugin Frameworks Pin
Florin Ochiana11-Mar-04 23:27
Florin Ochiana11-Mar-04 23:27 
GeneralRe: Plugin Frameworks Pin
Roger Allen12-Mar-04 1:05
Roger Allen12-Mar-04 1:05 
GeneralCCriticalSection Object frezee Pin
Do Manh Hung11-Mar-04 19:40
Do Manh Hung11-Mar-04 19:40 
GeneralRe: CCriticalSection Object frezee Pin
Neville Franks11-Mar-04 22:19
Neville Franks11-Mar-04 22:19 
GeneralRe: CCriticalSection Object frezee Pin
Do Manh Hung11-Mar-04 22:30
Do Manh Hung11-Mar-04 22:30 
GeneralRe: CCriticalSection Object frezee Pin
Neville Franks12-Mar-04 11:48
Neville Franks12-Mar-04 11:48 
Questionhow to hide a shortcut from desktop window? Pin
shoma11-Mar-04 18:24
shoma11-Mar-04 18:24 

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.