Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Dialog based application for different screen resolutions Pin
MANISH RASTOGI26-Oct-07 18:52
MANISH RASTOGI26-Oct-07 18:52 
AnswerRe: Dialog based application for different screen resolutions Pin
Nelek28-Oct-07 23:24
protectorNelek28-Oct-07 23:24 
QuestionLink error _imp_ Pin
ewpendleton26-Oct-07 6:44
ewpendleton26-Oct-07 6:44 
QuestionRe: Link error _imp_ Pin
Hamid_RT26-Oct-07 7:02
Hamid_RT26-Oct-07 7:02 
AnswerRe: Link error _imp_ Pin
ewpendleton26-Oct-07 9:26
ewpendleton26-Oct-07 9:26 
AnswerRe: Link error _imp_ Pin
Chris Losinger26-Oct-07 9:15
professionalChris Losinger26-Oct-07 9:15 
Questioncompile error,please help me, Pin
nhathoang26-Oct-07 5:48
nhathoang26-Oct-07 5:48 
AnswerRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 5:56
Mark Salsbery26-Oct-07 5:56 
class Y;  //<-- forward declaration

class X
{
   Y y;  <font color="Red">//<-- sizeof(Y) unknown here!</font>
};

class Y
{
   X x;
};
This shows the order the compiler needs to see the declarations, regardless of
whether you use header files or not.

This will only work with object pointers, since the compiler doesn't know the size of a Y
object when it encounters the X class.

The only solution, then, is something like:
class Y;  //<-- forward declaration

class X
{
   Y *py;
};

class Y
{
   X x;
};


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 7:21
nhathoang26-Oct-07 7:21 
GeneralRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 7:53
Mark Salsbery26-Oct-07 7:53 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 8:37
nhathoang26-Oct-07 8:37 
GeneralRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 8:53
Mark Salsbery26-Oct-07 8:53 
JokeRe: compile error,please help me, Pin
David Crow26-Oct-07 9:21
David Crow26-Oct-07 9:21 
GeneralRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 9:36
Mark Salsbery26-Oct-07 9:36 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 10:05
nhathoang26-Oct-07 10:05 
GeneralRe: compile error,please help me, Pin
Fernando A. Gomez F.26-Oct-07 18:08
Fernando A. Gomez F.26-Oct-07 18:08 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 21:55
nhathoang26-Oct-07 21:55 
GeneralRe: compile error,please help me, Pin
Mark Salsbery27-Oct-07 7:02
Mark Salsbery27-Oct-07 7:02 
GeneralRe: compile error,please help me, Pin
nhathoang27-Oct-07 8:09
nhathoang27-Oct-07 8:09 
QuestionRuntimeError: Invalid argument to sendto (plz help me out) Pin
majid mahmood26-Oct-07 5:16
majid mahmood26-Oct-07 5:16 
AnswerRe: RuntimeError: Invalid argument to sendto (plz help me out) Pin
Mark Salsbery26-Oct-07 6:12
Mark Salsbery26-Oct-07 6:12 
QuestionCreating a large DC Pin
Meisterzunge26-Oct-07 4:23
Meisterzunge26-Oct-07 4:23 
AnswerRe: Creating a large DC Pin
Chris Losinger26-Oct-07 4:45
professionalChris Losinger26-Oct-07 4:45 
QuestionRe: Creating a large DC Pin
bob1697226-Oct-07 4:46
bob1697226-Oct-07 4:46 
QuestionRe: Creating a large DC Pin
Hamid_RT26-Oct-07 7:30
Hamid_RT26-Oct-07 7:30 

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.