Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Spin Control Pin
AbhiHcl13-Jul-10 21:40
AbhiHcl13-Jul-10 21:40 
GeneralRe: Spin Control Pin
Richard MacCutchan13-Jul-10 21:51
mveRichard MacCutchan13-Jul-10 21:51 
AnswerRe: Spin Control Pin
chaau14-Jul-10 17:23
chaau14-Jul-10 17:23 
QuestionUsing MS Excel in VC++ Pin
QSMZ12-Jul-10 20:39
QSMZ12-Jul-10 20:39 
AnswerRe: Using MS Excel in VC++ Pin
Cedric Moonen12-Jul-10 21:30
Cedric Moonen12-Jul-10 21:30 
AnswerRe: Using MS Excel in VC++ Pin
Roger Stoltz13-Jul-10 0:08
Roger Stoltz13-Jul-10 0:08 
AnswerRe: Using MS Excel in VC++ Pin
Sameerkumar Namdeo13-Jul-10 0:31
Sameerkumar Namdeo13-Jul-10 0:31 
AnswerRe: Using MS Excel in VC++ Pin
SnowHow13-Jul-10 10:39
SnowHow13-Jul-10 10:39 
Questiongetting day of week Pin
zon_cpp12-Jul-10 19:35
zon_cpp12-Jul-10 19:35 

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.