Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalauto start program Pin
_tasleem14-Apr-05 10:42
_tasleem14-Apr-05 10:42 
GeneralRe: auto start program Pin
mark novak14-Apr-05 11:41
mark novak14-Apr-05 11:41 
GeneralRe: auto start program Pin
22491714-Apr-05 17:49
22491714-Apr-05 17:49 
GeneralAutoscroll a listbox Pin
Anonymous14-Apr-05 10:15
Anonymous14-Apr-05 10:15 
GeneralRe: Autoscroll a listbox Pin
Anonymous14-Apr-05 10:23
Anonymous14-Apr-05 10:23 
GeneralCComboBox without Border Pin
tobi7814-Apr-05 9:22
tobi7814-Apr-05 9:22 
GeneralThread Creation / Server Pin
brilliant10114-Apr-05 8:59
brilliant10114-Apr-05 8:59 
GeneralHelp! Many questions about using CString Pin
tttyip14-Apr-05 6:48
tttyip14-Apr-05 6:48 
Dear all,
I have quite a lot of questions about using CString in MFC correctly. Hope you can help me.


1) In VC++ documentation, it says "You can freely substitute CString objects for const char* and LPCTSTR function arguments." What is it meant? Is that I can safely pass CString object to functions that accept argument const char* or LPCTSTR (LPCSTR)?
For example, I have a function void testfunction1(const char* input1);
Can I call this function by:
CString s = "c:\\program files";
testfunction1(const char* input1);


2) For the Format function of the CString class, the VC++ documentation says "The call will fail if the string object itself is offered as a parameter to Format". Is that we cannot use the Format function in this way?
For example, Can I use the following codes safely?
CString test1 = "c:\\program files\\";
char folder[10] = "folder1";
CString FullPath;
FullPath.Format("%s%s", test1, folder);

Will FullPath be "c:\program files\folder1" ?

If I cannot use this method to for setting FullPath, what should I do to set the FULL path correctly?


3) Is the CString object NULL terminated?

4) What is the maximum number of characters for the CString object?

5) What is the meaning of "const" in the function argument?
eg. void thisfunction(const char* test, int test2);

Thanks all of your help.

GeneralRe: Help! Many questions about using CString Pin
David Crow14-Apr-05 7:59
David Crow14-Apr-05 7:59 
GeneralRe: Help! Many questions about using CString Pin
tttyip15-Apr-05 4:58
tttyip15-Apr-05 4:58 
GeneralDialog Insertion Help Pin
BritishEmpire14-Apr-05 5:53
BritishEmpire14-Apr-05 5:53 
GeneralRe: Dialog Insertion Help Pin
mark novak14-Apr-05 11:22
mark novak14-Apr-05 11:22 
GeneralI need help on this problem. Pin
daAnswer14-Apr-05 5:50
daAnswer14-Apr-05 5:50 
GeneralRe: I need help on this problem. Pin
Bob Flynn14-Apr-05 6:27
Bob Flynn14-Apr-05 6:27 
GeneralRe: I need help on this problem. Pin
Anonymous14-Apr-05 15:27
Anonymous14-Apr-05 15:27 
QuestionCookies in MFC? Pin
soundman3214-Apr-05 5:26
soundman3214-Apr-05 5:26 
AnswerRe: Cookies in MFC? Pin
David Crow14-Apr-05 7:47
David Crow14-Apr-05 7:47 
GeneralRe: Cookies in MFC? Pin
soundman3214-Apr-05 21:38
soundman3214-Apr-05 21:38 
QuestionGDI+ bug? Pin
ZHANG, Lei14-Apr-05 5:00
ZHANG, Lei14-Apr-05 5:00 
AnswerRe: GDI+ bug? Pin
PJ Arends14-Apr-05 11:03
professionalPJ Arends14-Apr-05 11:03 
GeneralDisplaying text in a textbox from one form to another form Pin
underb@asd20.org14-Apr-05 4:56
underb@asd20.org14-Apr-05 4:56 
GeneralRe: Displaying text in a textbox from one form to another form Pin
Joel Holdsworth14-Apr-05 12:44
Joel Holdsworth14-Apr-05 12:44 
General[Message Deleted] Pin
Adeel Chaudhry14-Apr-05 4:10
Adeel Chaudhry14-Apr-05 4:10 
GeneralRe: i want two header files of VC6!!! Pin
David Crow14-Apr-05 4:45
David Crow14-Apr-05 4:45 
GeneralRe: i want two header files of VC6!!! Pin
John M. Drescher14-Apr-05 5:47
John M. Drescher14-Apr-05 5:47 

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.