Click here to Skip to main content
15,902,112 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionParameter passsing between classes Pin
chaitannya_m11-Jul-07 6:03
chaitannya_m11-Jul-07 6:03 
AnswerRe: Parameter passsing between classes Pin
Electronic7511-Jul-07 6:10
Electronic7511-Jul-07 6:10 
GeneralRe: Parameter passsing between classes Pin
chaitannya_m11-Jul-07 6:54
chaitannya_m11-Jul-07 6:54 
GeneralRe: Parameter passsing between classes Pin
sheshidar11-Jul-07 18:07
sheshidar11-Jul-07 18:07 
AnswerRe: Parameter passsing between classes Pin
chaitannya_m11-Jul-07 7:29
chaitannya_m11-Jul-07 7:29 
QuestionRe: Parameter passsing between classes Pin
JudyL_MD11-Jul-07 7:40
JudyL_MD11-Jul-07 7:40 
AnswerRe: Parameter passsing between classes Pin
chaitannya_m11-Jul-07 9:04
chaitannya_m11-Jul-07 9:04 
GeneralRe: Parameter passsing between classes Pin
JudyL_MD12-Jul-07 3:41
JudyL_MD12-Jul-07 3:41 
I'm not saying that the member itself of class A goes out of scope, I'm suggesting that what was assigned to the member went out of scope. The member itself is still good but it is referncing memory that is no longer good .You see this a lot with objects created on the stack. For example:

char *MyCreateFunc ()
{
char buffer[256]

// do all the stuff to fill in buffer

return buffer;
}

The statement
A::m_memberVar = MyCreateFunc ();

will compile and execute and may even work as expected sometimes. However, it is wrong!! A::m_memberVar remains in scope but what it points to is no longer in scope because the memory containing the data is no longer valid once the MyCreateFunc returns.

Show the code where you create the value assigned to the member of class A. The member variables of a class remains in scope until the class itself goes out of scope, so unless you're accessing class A incorrectly, the problem has got to be in the value assigned to the member variable.

Judy

Questionrun an EXE for all users of the computer Pin
rahul398511-Jul-07 5:29
rahul398511-Jul-07 5:29 
QuestionRe: run an EXE for all users of the computer Pin
David Crow11-Jul-07 6:00
David Crow11-Jul-07 6:00 
AnswerRe: run an EXE for all users of the computer Pin
Randor 11-Jul-07 6:22
professional Randor 11-Jul-07 6:22 
QuestionHow to get IDD of a PropertyPage dialog? [modified] Pin
Electronic7511-Jul-07 5:21
Electronic7511-Jul-07 5:21 
AnswerRe: How to get IDD of a PropertyPage dialog? Pin
David Crow11-Jul-07 6:11
David Crow11-Jul-07 6:11 
GeneralRe: How to get IDD of a PropertyPage dialog? Pin
Electronic7511-Jul-07 6:28
Electronic7511-Jul-07 6:28 
Question.hpj errror Pin
sridharsb200711-Jul-07 4:58
sridharsb200711-Jul-07 4:58 
Questiontaking variable value to another class Pin
Maynka11-Jul-07 3:53
Maynka11-Jul-07 3:53 
QuestionRe: taking variable value to another class Pin
David Crow11-Jul-07 4:07
David Crow11-Jul-07 4:07 
AnswerRe: taking variable value to another class Pin
Emmanouil11-Jul-07 4:12
Emmanouil11-Jul-07 4:12 
AnswerRe: taking variable value to another class Pin
sheshidar11-Jul-07 18:21
sheshidar11-Jul-07 18:21 
QuestionRich text format of text Pin
Jhony george11-Jul-07 3:39
Jhony george11-Jul-07 3:39 
AnswerRe: Rich text format of text Pin
Randor 11-Jul-07 6:12
professional Randor 11-Jul-07 6:12 
QuestionLogging of data Pin
Maynka11-Jul-07 3:38
Maynka11-Jul-07 3:38 
AnswerRe: Logging of data Pin
David Crow11-Jul-07 4:04
David Crow11-Jul-07 4:04 
QuestionOne project linking to files in another project Pin
Marimuthu.r11-Jul-07 3:04
Marimuthu.r11-Jul-07 3:04 
AnswerRe: One project linking to files in another project Pin
Cedric Moonen11-Jul-07 3:07
Cedric Moonen11-Jul-07 3:07 

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.