Click here to Skip to main content
16,005,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Add EditControl Pin
David Crow27-Aug-08 3:06
David Crow27-Aug-08 3:06 
GeneralRe: Add EditControl Pin
Hamid_RT27-Aug-08 4:09
Hamid_RT27-Aug-08 4:09 
AnswerRe: Add EditControl Pin
Jijo.Raj27-Aug-08 2:15
Jijo.Raj27-Aug-08 2:15 
AnswerRe: Add EditControl Pin
Hamid_RT27-Aug-08 4:08
Hamid_RT27-Aug-08 4:08 
GeneralRe: Add EditControl Pin
MsmVc27-Aug-08 18:21
MsmVc27-Aug-08 18:21 
GeneralRe: Add EditControl Pin
MsmVc27-Aug-08 18:50
MsmVc27-Aug-08 18:50 
GeneralRe: Add EditControl Pin
Hamid_RT28-Aug-08 23:15
Hamid_RT28-Aug-08 23:15 
QuestionTwo way class access Pin
Dennis L27-Aug-08 0:43
Dennis L27-Aug-08 0:43 
Hi all!

I have the following class and i want a way to make the tree, and edit controls to have access to MAINCLASS variables.

a. Is that OK to create a constructor to each one of the controls to pass a parameter something like
Window* wn;
And use it as ((MAINCLASS *)mainwindow)->a; within class implementation ?

Or can you suggest me an other OOP way because i have read somewhere that this way to convert a base class object (mainwindow) to a derived class object is not so legal?

class MAINCLASS: public window
{
...
...
public:
//constructor
//destructor

MyTreeCtrl tc;
MyEditCtrl ec;
...
...
public:
// Variables
int a;
}

a.

// in MyTreeCtrl h
class MyTreeCtrl
{
...
...
public:
MyTreeCtrl(Window* wn)

void Foo();
...
...
public:
// Variables
Window *mainwindow;
};

// in MyTreeCtrl cpp
MyTreeCtrl::MyTreeCtrl(Window* wn)
{
mainwindow = wn;
}


MyTreeCtrl::void Foo()
{
...
int b = ((MAINCLASS *)mainwindow)->;a
...
}

Thanks!
AnswerRe: Two way class access Pin
SandipG 27-Aug-08 1:47
SandipG 27-Aug-08 1:47 
QuestionSet Directory Pin
MsmVc27-Aug-08 0:33
MsmVc27-Aug-08 0:33 
AnswerRe: Set Directory Pin
onlyjaypatel27-Aug-08 0:39
onlyjaypatel27-Aug-08 0:39 
GeneralRe: Set Directory Pin
MsmVc27-Aug-08 0:46
MsmVc27-Aug-08 0:46 
GeneralRe: Set Directory Pin
onlyjaypatel27-Aug-08 1:10
onlyjaypatel27-Aug-08 1:10 
AnswerRe: Set Directory Pin
Perspx27-Aug-08 0:41
Perspx27-Aug-08 0:41 
AnswerRe: Set Directory Pin
Varghese Paul M27-Aug-08 0:57
Varghese Paul M27-Aug-08 0:57 
GeneralRe: Set Directory Pin
MsmVc27-Aug-08 0:59
MsmVc27-Aug-08 0:59 
QuestionSO_RCVTIMEO not working for nonblocking socket Pin
onlyjaypatel27-Aug-08 0:27
onlyjaypatel27-Aug-08 0:27 
QuestionColor one coloumn text of ListCotrol ! Pin
Le@rner27-Aug-08 0:13
Le@rner27-Aug-08 0:13 
AnswerRe: Color one coloumn text of ListCotrol ! Pin
_AnsHUMAN_ 27-Aug-08 0:29
_AnsHUMAN_ 27-Aug-08 0:29 
AnswerRe: Color one coloumn text of ListCotrol ! Pin
SandipG 27-Aug-08 0:52
SandipG 27-Aug-08 0:52 
AnswerRe: Color one coloumn text of ListCotrol ! Pin
Hamid_RT27-Aug-08 4:25
Hamid_RT27-Aug-08 4:25 
AnswerRe: Color one coloumn text of ListCotrol ! Pin
decoder_8523-Nov-10 1:19
decoder_8523-Nov-10 1:19 
GeneralRe: Color one coloumn text of ListCotrol ! Pin
Le@rner23-Nov-10 1:23
Le@rner23-Nov-10 1:23 
GeneralRe: Color one coloumn text of ListCotrol ! Pin
decoder_8523-Nov-10 23:18
decoder_8523-Nov-10 23:18 
GeneralRe: Color one coloumn text of ListCotrol ! Pin
Le@rner24-Nov-10 0:03
Le@rner24-Nov-10 0:03 

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.