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

C / C++ / MFC

 
QuestionHow to center my dialogbox? Pin
tiaozi25-May-02 22:32
tiaozi25-May-02 22:32 
AnswerRe: How to center my dialogbox? Pin
hex25-May-02 22:58
hex25-May-02 22:58 
GeneralRe: How to center my dialogbox? Pin
tiaozi25-May-02 23:03
tiaozi25-May-02 23:03 
AnswerRe: How to center my dialogbox? Pin
Eugene Pustovoyt26-May-02 6:21
Eugene Pustovoyt26-May-02 6:21 
AnswerRe: How to center my dialogbox? Pin
26-May-02 12:18
suss26-May-02 12:18 
GeneralDrawing in CRichEdit Pin
25-May-02 22:18
suss25-May-02 22:18 
GeneralRe: Drawing in CRichEdit Pin
Mazdak26-May-02 1:19
Mazdak26-May-02 1:19 
GeneralThe variable lose it's value Pin
laphijia25-May-02 20:12
laphijia25-May-02 20:12 
I have a problem:
I declare a variable CString string; in Class1.
During the execution of Class1 I give a value to this variable
string = "hello";

After on Class 2 I declare a pointer to the Class1:
Class1* pClass;
pClass = Class1;

Now I want to utilize the value stored in string
AfxMessageBox(pClass->string);

But the messagebox show empty.

It's the same if I don't use a pointer:
Class1 newClass;
AfxMessageBox(newClass.string);

But If I make
pClass->string = "bingo";
AfxMessageBox(pClass->string);

BINGO!

What's up?

COnsider that Class1 and Class2 are both running at the same time, on two CFrameView.
I set to display AfxMessagesBox in the costructor and destructor of each class, so I know what's running at what time.

But why when I call the variable string from Class2 it's lost its value.
Confused | :confused:

Confused | :confused: Confused | :confused: Confused | :confused:

"Nelle cose del mondo non e' il sapere ma il volere che puo'."
GeneralRe: The variable lose it's value Pin
Martin Speiser25-May-02 23:13
Martin Speiser25-May-02 23:13 
GeneralRe: The variable lose it's value Pin
laphijia26-May-02 0:50
laphijia26-May-02 0:50 
GeneralVC++7 ? CRecordset - derived class Pin
hex25-May-02 20:03
hex25-May-02 20:03 
Generalproblem using desktopwindow as parent window Pin
mystro_AKA_kokie25-May-02 20:03
mystro_AKA_kokie25-May-02 20:03 
GeneralRe: problem using desktopwindow as parent window Pin
Philip Patrick26-May-02 2:35
professionalPhilip Patrick26-May-02 2:35 
Generalresizing control at runtime Pin
aldeba25-May-02 18:45
aldeba25-May-02 18:45 
GeneralRe: resizing control at runtime Pin
Ravi Bhavnani25-May-02 18:51
professionalRavi Bhavnani25-May-02 18:51 
GeneralRe: resizing control at runtime Pin
Paul M Watt25-May-02 19:09
mentorPaul M Watt25-May-02 19:09 
GeneralRe: resizing control at runtime Pin
aldeba25-May-02 19:53
aldeba25-May-02 19:53 
GeneralRe: resizing control at runtime Pin
Paul M Watt25-May-02 20:33
mentorPaul M Watt25-May-02 20:33 
GeneralRe: resizing control at runtime Pin
loket26-May-02 5:18
loket26-May-02 5:18 
GeneralVC.NET and ATL_MIN_CRT Pin
Christian Graus25-May-02 18:21
protectorChristian Graus25-May-02 18:21 
GeneralRe: VC.NET and ATL_MIN_CRT Pin
Christian Graus25-May-02 18:24
protectorChristian Graus25-May-02 18:24 
GeneralRe: VC.NET and ATL_MIN_CRT Pin
Michael Dunn25-May-02 18:50
sitebuilderMichael Dunn25-May-02 18:50 
GeneralRe: VC.NET and ATL_MIN_CRT Pin
Christian Graus25-May-02 23:35
protectorChristian Graus25-May-02 23:35 
GeneralDefine Pin
Alex Shar25-May-02 17:17
Alex Shar25-May-02 17:17 
Generalstupid question for formatting output Pin
DanYELL25-May-02 12:39
DanYELL25-May-02 12:39 

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.