Click here to Skip to main content
16,020,990 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to avoid memory leakage due to wglUseFontBitmaps(); Pin
anjanarakesh24-Nov-08 18:08
anjanarakesh24-Nov-08 18:08 
QuestionWhere is my form, and what is it? Pin
regnwald24-Nov-08 17:04
regnwald24-Nov-08 17:04 
AnswerRe: Where is my form, and what is it? Pin
Chandrasekharan P24-Nov-08 17:15
Chandrasekharan P24-Nov-08 17:15 
NewsGood news, Freeborders are search for some Sr.C++ Engineer Pin
pandapam24-Nov-08 15:33
pandapam24-Nov-08 15:33 
GeneralRe: Good news, Freeborders are search for some Sr.C++ Engineer Pin
Sophia_meng24-Nov-08 15:44
Sophia_meng24-Nov-08 15:44 
GeneralRe: Good news, Freeborders are search for some Sr.C++ Engineer Pin
Chandrasekharan P24-Nov-08 17:43
Chandrasekharan P24-Nov-08 17:43 
QuestionBasic C++ question Pin
Software200724-Nov-08 14:29
Software200724-Nov-08 14:29 
AnswerRe: Basic C++ question Pin
enhzflep24-Nov-08 16:16
enhzflep24-Nov-08 16:16 
Not quite sure if I understand you sft.

Would you like the value of m_Val to be the same after a call to A::DoFunction(....) as it was before?

Or do you simply want m_Val to hold whatever is put into it until it is explicitly changed again?

If the answer is (a) the first one, use some code like this:

void A::DoFunction(....)
{
double m_Temp_Val = m_Val;

....
m_Val = x^2/1000 ;

if(flag)
m_Val -= K;
....

m_Val = m_Temp_Val;
}

If however, the answer is (b), you already have posted code that will allow the value of m_Val to persist, or remain until the next time you choose to change it. Since m_Val is a class member, it's value will remain until either (a) you re-assign a value to it by using the A::DoFunction member(assuming no other member functions modify the value held by m_Val), or (b) the class object is destroyed, either by going out of scope, or explicitly via a call to the delete function.

S.
GeneralRe: Basic C++ question Pin
Software200724-Nov-08 16:31
Software200724-Nov-08 16:31 
GeneralRe: Basic C++ question Pin
enhzflep24-Nov-08 17:30
enhzflep24-Nov-08 17:30 
GeneralRe: Basic C++ question Pin
Software200724-Nov-08 17:58
Software200724-Nov-08 17:58 
GeneralRe: Basic C++ question Pin
enhzflep24-Nov-08 19:12
enhzflep24-Nov-08 19:12 
GeneralRe: Basic C++ question Pin
David Crow25-Nov-08 5:03
David Crow25-Nov-08 5:03 
GeneralRe: Basic C++ question Pin
Software200725-Nov-08 6:03
Software200725-Nov-08 6:03 
QuestionHelp about Dev C++ Pin
asdxxx24-Nov-08 12:40
asdxxx24-Nov-08 12:40 
AnswerRe: Help about Dev C++ Pin
enhzflep24-Nov-08 13:00
enhzflep24-Nov-08 13:00 
QuestionCreateFile() error Pin
iNoble24-Nov-08 8:09
iNoble24-Nov-08 8:09 
QuestionRe: CreateFile() error Pin
led mike24-Nov-08 9:20
led mike24-Nov-08 9:20 
GeneralRe: CreateFile() error [modified] Pin
iNoble24-Nov-08 9:23
iNoble24-Nov-08 9:23 
GeneralRe: CreateFile() error Pin
led mike24-Nov-08 9:55
led mike24-Nov-08 9:55 
QuestionRe: CreateFile() error Pin
David Crow24-Nov-08 17:38
David Crow24-Nov-08 17:38 
AnswerRe: CreateFile() error Pin
iNoble25-Nov-08 2:46
iNoble25-Nov-08 2:46 
QuestionMs embedded vc on pocket pc Pin
mousemicky24-Nov-08 7:38
mousemicky24-Nov-08 7:38 
AnswerRe: Ms embedded vc on pocket pc Pin
CPallini24-Nov-08 7:52
mveCPallini24-Nov-08 7:52 
QuestionUsing GDI+ to display static pictures in MFC dialogs with an alpha channel Pin
Sternocera24-Nov-08 6:34
Sternocera24-Nov-08 6:34 

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.