Click here to Skip to main content
15,920,636 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can i get / set IP, DNS, gateway ? Pin
zhangyuwu6-Aug-01 16:45
zhangyuwu6-Aug-01 16:45 
GeneralReading CPU/MB Temperature Pin
Robert Buldoc6-Aug-01 16:25
Robert Buldoc6-Aug-01 16:25 
QuestionCustom file icon ? Pin
Christian Graus6-Aug-01 14:21
protectorChristian Graus6-Aug-01 14:21 
AnswerRe: Custom file icon ? Pin
Andrew Peace6-Aug-01 14:49
Andrew Peace6-Aug-01 14:49 
GeneralRe: Custom file icon ? Pin
Christian Graus6-Aug-01 14:51
protectorChristian Graus6-Aug-01 14:51 
GeneralDumb add variable question Pin
otvac6-Aug-01 12:49
otvac6-Aug-01 12:49 
GeneralRe: Dumb add variable question Pin
Christian Graus6-Aug-01 13:23
protectorChristian Graus6-Aug-01 13:23 
QuestionHow to add a member variable of one class to another class Pin
JerzyPeter6-Aug-01 11:27
JerzyPeter6-Aug-01 11:27 
I have SDI app with Doc/View support.

I want to add a member variable m_MyList (based on a CListCtrl's derived class CMyListCtrl) to CMyView class.
So i put #include "MyListCtrl.h" in MyView.h (otherwise compler won't know what m_MyList is)

*********************************************
CMyView.h:

#include "MyListCtrl.h"

class CMyView : public CView
{
...
CMyDoc* GetDocument(); //error C2501
...
CMyListCtrl m_MyList;
...
};

*****************************************

In MyListCtrl.cpp I want to get the pointer to CMyView like this:

CMyView *v=(CMyView *)GetParent()

But compiler will complain that it doesn't know what CMyView is. The moment I #include "MyView.h" on the top of MyListCtrl.cpp I'm getting error C2143 and C2501. (Because it it circular refrence). How to solve this problem?

By the way, (assuming I don't have my new class CMyListCtrl yet) why line CMyDoc* GetDocument(); dosn't bomb ????????

How does compiler know what CMyDoc is ?????. There's no #include "MyDoc.h" in CMyView class definition.


error C2143: syntax error : missing ';' before '*'
error C2501: 'CMyDoc' : missing storage-class or type specifiers

Any comments?
Thanks,

Jerzy
AnswerRe: How to add a member variable of one class to another class Pin
Nemanja Trifunovic6-Aug-01 11:52
Nemanja Trifunovic6-Aug-01 11:52 
GeneralRe: How to add a member variable of one class to another class Pin
JerzyPeter7-Aug-01 3:50
JerzyPeter7-Aug-01 3:50 
GeneralRe: How to add a member variable of one class to another class Pin
User 98857-Aug-01 5:42
User 98857-Aug-01 5:42 
GeneralRe: How to add a member variable of one class to another class Pin
User 98857-Aug-01 5:42
User 98857-Aug-01 5:42 
GeneralRe: How to add a member variable of one class to another class Pin
JerzyPeter7-Aug-01 6:39
JerzyPeter7-Aug-01 6:39 
QuestionHow can I use a CRgn to draw on a CBitmap? Pin
Craig Miller6-Aug-01 11:08
Craig Miller6-Aug-01 11:08 
AnswerRe: How can I use a CRgn to draw on a CBitmap? Pin
Baafie6-Aug-01 12:13
Baafie6-Aug-01 12:13 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Craig Miller6-Aug-01 12:27
Craig Miller6-Aug-01 12:27 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Christian Graus6-Aug-01 12:39
protectorChristian Graus6-Aug-01 12:39 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Craig Miller6-Aug-01 12:45
Craig Miller6-Aug-01 12:45 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Christian Graus6-Aug-01 12:48
protectorChristian Graus6-Aug-01 12:48 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Craig Miller6-Aug-01 12:57
Craig Miller6-Aug-01 12:57 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Christian Graus6-Aug-01 13:23
protectorChristian Graus6-Aug-01 13:23 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Craig Miller6-Aug-01 13:30
Craig Miller6-Aug-01 13:30 
GeneralRe: How can I use a CRgn to draw on a CBitmap? Pin
Christian Graus6-Aug-01 13:32
protectorChristian Graus6-Aug-01 13:32 
GeneralIexplorer Pin
calebcohoon6-Aug-01 10:34
calebcohoon6-Aug-01 10:34 
GeneralRe: Iexplorer Pin
Not Active6-Aug-01 10:43
mentorNot Active6-Aug-01 10:43 

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.