Click here to Skip to main content
15,907,326 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: 10 & 10/3*3 are not equal ! ! ! WHY? PinPopular
Niklas L13-Jul-10 9:56
Niklas L13-Jul-10 9:56 
AnswerRe: 10 & 10/3*3 are not equal ! ! ! WHY? Pin
EverettJF13-Jul-10 14:47
EverettJF13-Jul-10 14:47 
GeneralRe: 10 & 10/3*3 are not equal ! ! ! WHY? Pin
Rick York13-Jul-10 16:32
mveRick York13-Jul-10 16:32 
AnswerRe: 10 & 10/3*3 are not equal ! ! ! WHY? Pin
Aescleal13-Jul-10 21:47
Aescleal13-Jul-10 21:47 
AnswerRe: 10 & 10/3*3 are not equal ! ! ! WHY? Pin
josda100014-Jul-10 6:26
josda100014-Jul-10 6:26 
QuestionDLL injection at start time. Pin
Code-o-mat13-Jul-10 6:13
Code-o-mat13-Jul-10 6:13 
QuestionWord automation using MFC - how to hide Word toolbar and menu bar Pin
Member 422150713-Jul-10 4:46
Member 422150713-Jul-10 4:46 
QuestionUsing Open SSL Pin
Rajmohan SK13-Jul-10 3:54
Rajmohan SK13-Jul-10 3:54 
AnswerRe: Using Open SSL Pin
Aescleal13-Jul-10 4:11
Aescleal13-Jul-10 4:11 
GeneralRe: Using Open SSL Pin
Rajmohan SK13-Jul-10 17:57
Rajmohan SK13-Jul-10 17:57 
Questionconst string reference variables Pin
apphia_j_7913-Jul-10 2:43
apphia_j_7913-Jul-10 2:43 
AnswerRe: const string reference variables Pin
Cedric Moonen13-Jul-10 2:47
Cedric Moonen13-Jul-10 2:47 
GeneralRe: const string reference variables Pin
apphia_j_7913-Jul-10 3:24
apphia_j_7913-Jul-10 3:24 
GeneralRe: const string reference variables Pin
Cedric Moonen13-Jul-10 3:32
Cedric Moonen13-Jul-10 3:32 
QuestionRe: const string reference variables Pin
CPallini13-Jul-10 2:58
mveCPallini13-Jul-10 2:58 
AnswerRe: const string reference variables Pin
Aescleal13-Jul-10 3:52
Aescleal13-Jul-10 3:52 
AnswerRe: const string reference variables Pin
Niklas L13-Jul-10 4:42
Niklas L13-Jul-10 4:42 
You should check the string before sending it to Reset, or the object owning the string. Taking its reference might be ok even if the instance no longer exists, but once you dereference it, you might get an access violation.

Typically, problems like this occurs if your string is a member variable in an instance you have deleted (or is null).

class A
{
    string s;
public:
    void method() { Reset(s); }
};
A *a = nullptr;
a->method();


The above code will work when Reset() takes a reference to the string, but not if it accesses its value, which a call-by-value does.

QuestionC2782 Pin
T.RATHA KRISHNAN13-Jul-10 1:47
T.RATHA KRISHNAN13-Jul-10 1:47 
AnswerRe: C2782 Pin
Cedric Moonen13-Jul-10 2:09
Cedric Moonen13-Jul-10 2:09 
AnswerRe: C2782 Pin
Emilio Garavaglia13-Jul-10 7:20
Emilio Garavaglia13-Jul-10 7:20 
Questionimport a registry file in the registry editor Pin
mazizi13-Jul-10 1:07
mazizi13-Jul-10 1:07 
AnswerRe: import a registry file in the registry editor Pin
Electron Shepherd13-Jul-10 3:05
Electron Shepherd13-Jul-10 3:05 
GeneralRe: import a registry file in the registry editor Pin
mazizi13-Jul-10 19:14
mazizi13-Jul-10 19:14 
QuestionSpin Control Pin
AbhiHcl13-Jul-10 0:52
AbhiHcl13-Jul-10 0:52 
AnswerRe: Spin Control Pin
Richard MacCutchan13-Jul-10 1:33
mveRichard MacCutchan13-Jul-10 1:33 

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.