Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Global objects in MFC Pin
TOlivier15-Aug-05 4:15
TOlivier15-Aug-05 4:15 
GeneralRe: Global objects in MFC Pin
Achim Klein15-Aug-05 15:01
Achim Klein15-Aug-05 15:01 
GeneralRe: Global objects in MFC Pin
TOlivier16-Aug-05 4:24
TOlivier16-Aug-05 4:24 
GeneralRe: Global objects in MFC Pin
Stephan Pilz15-Aug-05 3:51
Stephan Pilz15-Aug-05 3:51 
GeneralRe: Global objects in MFC Pin
TOlivier15-Aug-05 4:17
TOlivier15-Aug-05 4:17 
GeneralRe: Global objects in MFC Pin
Achim Klein15-Aug-05 4:45
Achim Klein15-Aug-05 4:45 
GeneralRe: Global objects in MFC Pin
TOlivier15-Aug-05 11:15
TOlivier15-Aug-05 11:15 
GeneralRe: Global objects in MFC Pin
Achim Klein15-Aug-05 12:07
Achim Klein15-Aug-05 12:07 
OK,

if I'm getting it right, you would like to access member-variables
that reside in one of your classes while you are processing a method
that is a member of another class.

At first:
Classes don't 'have' variables in terms of allocating memory for them. These are only declarations.
If you want to assign values to member-variables you have to create an object of that specific class,
or you have to declare these variables 'static'.

To set an example (guess we are inside the Foo class):

// if you want to get information that a user has entered in a dialog
void Foo::OnFoo()
{
// create your object
FooDlg dlg;

// show it
dlg.DoModal();

// access its members
m_foo1 = dlg.foo1;
m_foo2 = dlg.foo2;
}

// if you want to show some of your information in a dialog
void Foo::OnFoo()
{
// create your object
FooDlg dlg;

// continue initialization
dlg.m_calledFrom = this;
// while FooDlg::m_calledFrom is declared as Foo* m_calledFrom; in the public section of your FooDlg class

// show it
dlg.DoModal();
}


I hope, I didn't miss the point...

Regards

GeneralRe: Global objects in MFC Pin
Bob Stanneveld15-Aug-05 6:05
Bob Stanneveld15-Aug-05 6:05 
GeneralRe: Global objects in MFC Pin
TOlivier15-Aug-05 11:26
TOlivier15-Aug-05 11:26 
GeneralRe: Global objects in MFC Pin
Achim Klein15-Aug-05 13:52
Achim Klein15-Aug-05 13:52 
GeneralRe: Global objects in MFC Pin
Achim Klein15-Aug-05 13:56
Achim Klein15-Aug-05 13:56 
GeneralRe: Global objects in MFC Pin
Achim Klein15-Aug-05 14:36
Achim Klein15-Aug-05 14:36 
GeneralRe: Global objects in MFC Pin
TOlivier16-Aug-05 4:31
TOlivier16-Aug-05 4:31 
GeneralRe: Global objects in MFC Pin
Emilio Garavaglia15-Aug-05 22:14
Emilio Garavaglia15-Aug-05 22:14 
GeneralPlay Audio CD via Soundcard Pin
Storm-blade15-Aug-05 3:10
professionalStorm-blade15-Aug-05 3:10 
GeneralRe: Play Audio CD via Soundcard Pin
M.Mehrdad.M15-Aug-05 3:51
M.Mehrdad.M15-Aug-05 3:51 
GeneralRe: Play Audio CD via Soundcard Pin
Storm-blade15-Aug-05 4:35
professionalStorm-blade15-Aug-05 4:35 
GeneralProblem with "Create a FrameWnd inside a thread" Pin
Stephan Pilz15-Aug-05 2:41
Stephan Pilz15-Aug-05 2:41 
GeneralRe: Problem with "Create a FrameWnd inside a thread" Pin
khan++15-Aug-05 2:47
khan++15-Aug-05 2:47 
GeneralRe: Problem with "Create a FrameWnd inside a thread" Pin
Stephan Pilz15-Aug-05 3:44
Stephan Pilz15-Aug-05 3:44 
GeneralRe: Problem with "Create a FrameWnd inside a thread" Pin
HumanOsc15-Aug-05 4:51
HumanOsc15-Aug-05 4:51 
GeneralRe: Problem with "Create a FrameWnd inside a thread" Pin
Stephan Pilz15-Aug-05 20:08
Stephan Pilz15-Aug-05 20:08 
GeneralRe: Problem with "Create a FrameWnd inside a thread" Pin
Stephan Pilz15-Aug-05 20:52
Stephan Pilz15-Aug-05 20:52 
GeneralRe: Problem with "Create a FrameWnd inside a thread" Pin
Sheng Jiang 蒋晟15-Aug-05 15:49
Sheng Jiang 蒋晟15-Aug-05 15:49 

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.