Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory Allocation Error 998 Pin
Richard Andrew x6425-Feb-09 16:08
professionalRichard Andrew x6425-Feb-09 16:08 
AnswerRe: Memory Allocation Error 998 Pin
ky_rerun25-Feb-09 16:25
ky_rerun25-Feb-09 16:25 
GeneralRe: Memory Allocation Error 998 Pin
Richard Andrew x6425-Feb-09 16:30
professionalRichard Andrew x6425-Feb-09 16:30 
AnswerRe: Memory Allocation Error 998 Pin
User 268325825-Feb-09 19:39
User 268325825-Feb-09 19:39 
QuestionForward Declarations, Inheritance and Circular dependancies Pin
thelonesquirrely25-Feb-09 10:19
thelonesquirrely25-Feb-09 10:19 
AnswerRe: Forward Declarations, Inheritance and Circular dependancies Pin
Jonathan Davies25-Feb-09 10:41
Jonathan Davies25-Feb-09 10:41 
GeneralRe: Forward Declarations, Inheritance and Circular dependancies Pin
thelonesquirrely25-Feb-09 10:54
thelonesquirrely25-Feb-09 10:54 
AnswerRe: Forward Declarations, Inheritance and Circular dependancies Pin
led mike25-Feb-09 11:55
led mike25-Feb-09 11:55 
thelonesquirrely wrote:
(in TaskQueue.h)
#ifndef TASK_QUEUE_H
#define TASK_QUEUE_H

#include "Tasks.h"

class MessageHandler; //forward declaration


It seems you don't understand the fundamental concept of a forward declaration. It provides the mechanism for the storage of a typed pointer without the inclusion of the header file.

In your post Tasks.h defines MessageHandler so the the inclusion of the header file negates the need to use a forward declaration.

// in A.h

class A{
  void what(){ printf("hello"); }
};

// in B.h where there is no #include of A.h

class A;  // forward declaration

class B{
A* myAPtr;     // declare typed pointer to the forward declared type
void myFunc();
};

// in B.cpp
#include "B.h"
#include "A.h"

// use the pointer because now we have the header that defines the type included
void B::myFunc(){ myAPtr->what(); }

AnswerRe: Forward Declarations, Inheritance and Circular dependancies Pin
Stuart Dootson25-Feb-09 11:59
professionalStuart Dootson25-Feb-09 11:59 
GeneralRe: Forward Declarations, Inheritance and Circular dependancies Pin
thelonesquirrely25-Feb-09 13:02
thelonesquirrely25-Feb-09 13:02 
QuestionError creating an object based on a dialog declared in a .rc resource file Pin
Goo225-Feb-09 9:49
Goo225-Feb-09 9:49 
AnswerRe: Error creating an object based on a dialog declared in a .rc resource file Pin
Jonathan Davies25-Feb-09 10:10
Jonathan Davies25-Feb-09 10:10 
GeneralRe: Error creating an object based on a dialog declared in a .rc resource file Pin
Goo225-Feb-09 11:49
Goo225-Feb-09 11:49 
GeneralRe: Error creating an object based on a dialog declared in a .rc resource file Pin
Goo225-Feb-09 12:45
Goo225-Feb-09 12:45 
GeneralRe: Error creating an object based on a dialog declared in a .rc resource file Pin
Jonathan Davies25-Feb-09 14:16
Jonathan Davies25-Feb-09 14:16 
QuestionHow can I access CView within CDoc in a SDI? Pin
Joseph Marzbani25-Feb-09 9:41
Joseph Marzbani25-Feb-09 9:41 
AnswerRe: How can I access CView within CDoc in a SDI? Pin
Jonathan Davies25-Feb-09 10:30
Jonathan Davies25-Feb-09 10:30 
AnswerRe: How can I access CView within CDoc in a SDI? Pin
«_Superman_»25-Feb-09 17:41
professional«_Superman_»25-Feb-09 17:41 
AnswerRe: How can I access CView within CDoc in a SDI? Pin
Hamid_RT25-Feb-09 19:43
Hamid_RT25-Feb-09 19:43 
AnswerRe: How can I access CView within CDoc in a SDI? Pin
Iain Clarke, Warrior Programmer26-Feb-09 1:54
Iain Clarke, Warrior Programmer26-Feb-09 1:54 
QuestionHow to resolve LNK2001 error (ver: VC ++ 8.0 and .net 2005) Pin
SIJUTHOMASP25-Feb-09 9:14
professionalSIJUTHOMASP25-Feb-09 9:14 
AnswerRe: How to resolve LNK2001 error (ver: VC ++ 8.0 and .net 2005) Pin
ky_rerun25-Feb-09 16:21
ky_rerun25-Feb-09 16:21 
GeneralRe: How to resolve LNK2001 error (ver: VC ++ 8.0 and .net 2005) Pin
SIJUTHOMASP26-Feb-09 3:15
professionalSIJUTHOMASP26-Feb-09 3:15 
AnswerRe: How to resolve LNK2001 error (ver: VC ++ 8.0 and .net 2005) Pin
SIJUTHOMASP26-Feb-09 8:59
professionalSIJUTHOMASP26-Feb-09 8:59 
Questionwindows message - when the window was displayed Pin
daavena25-Feb-09 8:18
daavena25-Feb-09 8:18 

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.