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

C / C++ / MFC

 
GeneralRe: Obtain a value from a variable in a class method. Pin
toxcct8-Nov-07 6:23
toxcct8-Nov-07 6:23 
GeneralRe: Obtain a value from a variable in a class method. Pin
e40s8-Nov-07 6:37
e40s8-Nov-07 6:37 
GeneralRe: Obtain a value from a variable in a class method. Pin
toxcct8-Nov-07 6:45
toxcct8-Nov-07 6:45 
GeneralRe: Obtain a value from a variable in a class method. Pin
e40s8-Nov-07 7:00
e40s8-Nov-07 7:00 
GeneralRe: Obtain a value from a variable in a class method. Pin
BadKarma8-Nov-07 5:13
BadKarma8-Nov-07 5:13 
GeneralRe: Obtain a value from a variable in a class method. Pin
e40s8-Nov-07 5:26
e40s8-Nov-07 5:26 
GeneralRe: Obtain a value from a variable in a class method. Pin
David Crow8-Nov-07 8:43
David Crow8-Nov-07 8:43 
GeneralRe: Obtain a value from a variable in a class method. [modified] Pin
e40s8-Nov-07 9:05
e40s8-Nov-07 9:05 
I learned about global and local variables when I started programming in C a couple of years ago from K&R. Both were clear. I don't use C often, and when I don't it becomes rusty, but global and local variables were pretty basic stuff then as now. They are not the issue.

I could have carried this out with a global variable, but everywhere I turned I was advised to use a class member variable. This is why your confirmation of that advice as well as your convincing statement that the ::OnDataReady contruct was off limits was so valuable.

But I don't know the class nomenclature or what the rules are beyond the basics of public, private, protected; I don't know that I'm supposed to write something this way

CString CMemMapCppClientDlg::GetContent()<br />
{<br />
  return m_strContent;<br />
}


and I also don't know that there necessarily isn't a pointer or something or other way to get at something behind a scope resolution operator that I don't know about because I've never learned C++ (unless someone experienced with the language like you tells me in the earlier post at top), and I've never learned about both objects and class syntax in the same breath. I don't know that in addition to overloaded operators that there may also be some way to dereference some variable out of an off-limits ::OnDataReady method. That's why your posts helped and why BK's post was so incredible important in helping me to learn how the syntax is constructed while getting at the variable--not just any way, but the experienced C++ coder's way.

Otherwise why bother. I'd have just used a global and called it a day, but I wouldn't have grown. I wouldn't have learned the proper way. Everybody was telling me to use a class member variable, but I had no idea how to implement one, what to write?, which goes where?, etc. It's Greek to me. Now I can learn from BK's generous and incredibly detailed example.

Thanks all. Everyone. Including txcct. You all helped me to learn how to do this.






-- modified at 16:03 Thursday 8th November, 2007
Questionc++ path management functions Pin
Capitanevs7-Nov-07 10:15
Capitanevs7-Nov-07 10:15 
AnswerRe: c++ path management functions Pin
Mark Salsbery7-Nov-07 10:44
Mark Salsbery7-Nov-07 10:44 
GeneralRe: c++ path management functions Pin
Peter Weyzen7-Nov-07 15:33
Peter Weyzen7-Nov-07 15:33 
GeneralRe: c++ path management functions Pin
Roger Broomfield7-Nov-07 15:52
Roger Broomfield7-Nov-07 15:52 
QuestionHow can i open some Form application as child of other Form application ? Pin
Yanshof7-Nov-07 10:05
Yanshof7-Nov-07 10:05 
AnswerRe: How can i open some Form application as child of other Form application ? Pin
Hamid_RT7-Nov-07 17:36
Hamid_RT7-Nov-07 17:36 
GeneralRe: How can i open some Form application as child of other Form application ? Pin
Yanshof7-Nov-07 19:20
Yanshof7-Nov-07 19:20 
AnswerRe: How can i open some Form application as child of other Form application ? Pin
Nelek7-Nov-07 21:20
protectorNelek7-Nov-07 21:20 
GeneralRe: How can i open some Form application as child of other Form application ? Pin
Hamid_RT8-Nov-07 2:46
Hamid_RT8-Nov-07 2:46 
QuestionProject snapshot Pin
Larrson127-Nov-07 9:34
Larrson127-Nov-07 9:34 
AnswerRe: Project snapshot Pin
Maximilien7-Nov-07 9:52
Maximilien7-Nov-07 9:52 
AnswerRe: Project snapshot Pin
Peter Weyzen7-Nov-07 15:40
Peter Weyzen7-Nov-07 15:40 
QuestionURGENT : strange error C4430 VS2005 with ostream Pin
AhmedOsamaMoh7-Nov-07 8:08
AhmedOsamaMoh7-Nov-07 8:08 
AnswerRe: URGENT : strange error C4430 VS2005 with ostream Pin
Mark Salsbery7-Nov-07 8:18
Mark Salsbery7-Nov-07 8:18 
JokeRe: URGENT : strange error C4430 VS2005 with ostream Pin
AhmedOsamaMoh7-Nov-07 8:22
AhmedOsamaMoh7-Nov-07 8:22 
GeneralRe: URGENT : strange error C4430 VS2005 with ostream Pin
led mike7-Nov-07 8:44
led mike7-Nov-07 8:44 
Questionconnecting to a parallel port problem. Please Help Pin
Wamuti7-Nov-07 7:29
Wamuti7-Nov-07 7:29 

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.