Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIssue while Use DLL in MFC Exe Application Pin
Andraw Tang31-Mar-11 9:01
Andraw Tang31-Mar-11 9:01 
AnswerRe: Issue while Use DLL in MFC Exe Application Pin
Albert Holguin31-Mar-11 9:28
professionalAlbert Holguin31-Mar-11 9:28 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Andraw Tang31-Mar-11 9:33
Andraw Tang31-Mar-11 9:33 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Albert Holguin31-Mar-11 9:38
professionalAlbert Holguin31-Mar-11 9:38 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Andraw Tang31-Mar-11 10:53
Andraw Tang31-Mar-11 10:53 
GeneralRe: Issue while Use DLL in MFC Exe Application Pin
Albert Holguin31-Mar-11 11:00
professionalAlbert Holguin31-Mar-11 11:00 
QuestionAnything wrong Pin
Smith#31-Mar-11 4:46
Smith#31-Mar-11 4:46 
AnswerRe: Anything wrong [modified] Pin
Luc Pattyn31-Mar-11 5:17
sitebuilderLuc Pattyn31-Mar-11 5:17 
GeneralRe: Anything wrong Pin
Smith#31-Mar-11 5:33
Smith#31-Mar-11 5:33 
AnswerRe: Anything wrong Pin
Luc Pattyn31-Mar-11 7:18
sitebuilderLuc Pattyn31-Mar-11 7:18 
GeneralRe: Anything wrong Pin
CPallini31-Mar-11 7:37
mveCPallini31-Mar-11 7:37 
AnswerRe: Anything wrong Pin
Luc Pattyn31-Mar-11 7:41
sitebuilderLuc Pattyn31-Mar-11 7:41 
GeneralRe: Anything wrong Pin
CPallini31-Mar-11 8:02
mveCPallini31-Mar-11 8:02 
GeneralRe: Anything wrong Pin
Luc Pattyn31-Mar-11 8:09
sitebuilderLuc Pattyn31-Mar-11 8:09 
GeneralRe: Anything wrong Pin
CPallini31-Mar-11 8:17
mveCPallini31-Mar-11 8:17 
AnswerRe: Anything wrong Pin
CPallini31-Mar-11 5:44
mveCPallini31-Mar-11 5:44 
GeneralRe: Anything wrong Pin
Smith#31-Mar-11 5:52
Smith#31-Mar-11 5:52 
GeneralRe: Anything wrong Pin
Waldermort31-Mar-11 6:14
Waldermort31-Mar-11 6:14 
GeneralRe: Anything wrong Pin
Smith#31-Mar-11 6:22
Smith#31-Mar-11 6:22 
GeneralRe: Anything wrong Pin
Waldermort31-Mar-11 6:35
Waldermort31-Mar-11 6:35 
No. When dealing with string buffers you only need to set the first char/wchar/tchar to 0.

char myString[100]; // Is a buffer of 100 chars the a string may be copied into.<br />
strcat( myString, "Hello World!" ); // will fail because the buffer is full of junk.<br />
// but<br />
strcpy( myString, "World!" ); // will work because it doesn't care what is in the buffer<br />
myString[0] = 0; // copies an empty string to the buffer<br />
strcat( myString, "Hello World!" ); // appends the string to the empty string ( also sets the character after '!' to \0 or NULL.


The new string is actually 13 chars because there is a 0 at the end.

On another note. You shouldn't be using those string functions. There are safer versions available:
strcpy_s( myString, 100, "Hello World!" );
These check to make sure the buffer is large enough for the string

Also, you might want to read up on TCHAR and the unicode/ansi string functions
TCHAR myString[100];<br />
_tcscpy_s( myString, 100, _T("Hello World!");

Waldermort

GeneralRe: Anything wrong Pin
Luc Pattyn31-Mar-11 7:18
sitebuilderLuc Pattyn31-Mar-11 7:18 
GeneralRe: Anything wrong Pin
CPallini31-Mar-11 7:36
mveCPallini31-Mar-11 7:36 
GeneralRe: Anything wrong Pin
Luc Pattyn31-Mar-11 7:39
sitebuilderLuc Pattyn31-Mar-11 7:39 
GeneralRe: Anything wrong Pin
CPallini31-Mar-11 8:02
mveCPallini31-Mar-11 8:02 
QuestionCompare And Set 64 bit Pin
Waldermort31-Mar-11 1:40
Waldermort31-Mar-11 1:40 

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.