Click here to Skip to main content
15,914,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to begin DirectX Pin
Nishad S8-Sep-07 0:57
Nishad S8-Sep-07 0:57 
GeneralRe: How to begin DirectX Pin
kcynic8-Sep-07 2:16
kcynic8-Sep-07 2:16 
Questionkernel mode dll Pin
samira forooghi7-Sep-07 19:44
samira forooghi7-Sep-07 19:44 
QuestionSome ambiguities with MFC CString class. [modified] Pin
Hamed Musavi7-Sep-07 19:20
Hamed Musavi7-Sep-07 19:20 
AnswerRe: Some ambigituies with MFC CString class. Pin
chandu0047-Sep-07 19:26
chandu0047-Sep-07 19:26 
GeneralRe: Some ambigituies with MFC CString class. Pin
Hamed Musavi7-Sep-07 19:36
Hamed Musavi7-Sep-07 19:36 
GeneralRe: Some ambigituies with MFC CString class. Pin
Cedric Moonen7-Sep-07 22:57
Cedric Moonen7-Sep-07 22:57 
AnswerRe: Some ambiguities with MFC CString class. Pin
progDes7-Sep-07 20:26
progDes7-Sep-07 20:26 
2. The class is always safer then pointer. The sizeof(CString) is always identically, that's why you can easy pass it as a function parameter. Because string data is containing somewhere in heap and CString just contain pointer to this data. That's why the sizeof(CString("short string")) == sizeof("very very long string"). One more thing thing you should know, that when you pass CString as a function parameter by value the copy constructor is caling, so the data can be copied or it can be reference counting system. Anyway while the CString constructor is calling the class is safe.

1.
char * c = new char[10];
CString s = c; // the data is not pointing to c, it is copied here, so you need to delete c


GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi7-Sep-07 20:53
Hamed Musavi7-Sep-07 20:53 
AnswerRe: Some ambiguities with MFC CString class. Pin
progDes7-Sep-07 22:29
progDes7-Sep-07 22:29 
GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi8-Sep-07 4:11
Hamed Musavi8-Sep-07 4:11 
AnswerRe: Some ambiguities with MFC CString class. Pin
John R. Shaw7-Sep-07 22:07
John R. Shaw7-Sep-07 22:07 
GeneralRe: Some ambiguities with MFC CString class. [modified] Pin
Hamed Musavi8-Sep-07 4:08
Hamed Musavi8-Sep-07 4:08 
AnswerRe: Some ambiguities with MFC CString class. Pin
bob169728-Sep-07 4:36
bob169728-Sep-07 4:36 
GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi8-Sep-07 4:41
Hamed Musavi8-Sep-07 4:41 
GeneralRe: Some ambiguities with MFC CString class. Pin
progDes8-Sep-07 6:05
progDes8-Sep-07 6:05 
GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi8-Sep-07 18:45
Hamed Musavi8-Sep-07 18:45 
AnswerRe: Some ambiguities with MFC CString class. Pin
Mark Salsbery8-Sep-07 6:42
Mark Salsbery8-Sep-07 6:42 
GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi8-Sep-07 9:04
Hamed Musavi8-Sep-07 9:04 
GeneralRe: Some ambiguities with MFC CString class. Pin
Mark Salsbery8-Sep-07 10:59
Mark Salsbery8-Sep-07 10:59 
GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi8-Sep-07 15:53
Hamed Musavi8-Sep-07 15:53 
GeneralRe: Some ambiguities with MFC CString class. Pin
Mark Salsbery9-Sep-07 6:51
Mark Salsbery9-Sep-07 6:51 
GeneralRe: Some ambiguities with MFC CString class. Pin
Hamed Musavi9-Sep-07 18:11
Hamed Musavi9-Sep-07 18:11 
QuestionSOLVED: MFC: document-view problem [modified] Pin
progDes7-Sep-07 18:41
progDes7-Sep-07 18:41 
AnswerRe: MFC: document-view problem Pin
chandu0047-Sep-07 19:39
chandu0047-Sep-07 19:39 

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.