Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVariable args Pin
Waldermort13-Feb-07 13:17
Waldermort13-Feb-07 13:17 
AnswerRe: Variable args Pin
PJ Arends13-Feb-07 13:27
professionalPJ Arends13-Feb-07 13:27 
AnswerRe: Variable args Pin
Nibu babu thomas13-Feb-07 17:13
Nibu babu thomas13-Feb-07 17:13 
GeneralRe: Variable args Pin
Waldermort13-Feb-07 19:38
Waldermort13-Feb-07 19:38 
QuestionHelp about #include"Pnl_dll.hpp" Pin
abbd13-Feb-07 13:08
abbd13-Feb-07 13:08 
AnswerRe: Help about #include"Pnl_dll.hpp" Pin
PJ Arends13-Feb-07 13:37
professionalPJ Arends13-Feb-07 13:37 
AnswerRe: Help about #include"Pnl_dll.hpp" Pin
Christian Graus13-Feb-07 13:58
protectorChristian Graus13-Feb-07 13:58 
Questiondeprecated functions [modified] Pin
Waldermort13-Feb-07 12:14
Waldermort13-Feb-07 12:14 
I'm having somewhat of an issue with the new 'safe' string functions. Take the following example:
char foo[ 512 ] = {0};
strcat_s( foo, 512, "Hello World" );
 
char bar[ 512 ];
ZeroMemory( bar, 512 );
 
strcpy_s( bar, 512, foo );

Nothing wrong with the code you might think, but add bar to your watch list. Even though the memory was zero'd out, the string was written, but everything after the null character has been set to 0xFD.

In most cases this is not a problem, but I am using these with a memory mapped file. And it's causing havoc. Even strncpy_s displays the same problem. The only solution is to use CopyMemory(), after calling strlen() and adding the null.


-- modified at 19:11 Tuesday 13th February, 2007
AnswerRe: deprecated functions Pin
PJ Arends13-Feb-07 12:54
professionalPJ Arends13-Feb-07 12:54 
GeneralRe: deprecated functions Pin
Waldermort13-Feb-07 13:11
Waldermort13-Feb-07 13:11 
QuestionGetting text under the cursor Pin
RandyS13-Feb-07 12:00
RandyS13-Feb-07 12:00 
AnswerRe: Getting text under the cursor Pin
Christian Graus13-Feb-07 12:13
protectorChristian Graus13-Feb-07 12:13 
GeneralRe: Getting text under the cursor Pin
RandyS14-Feb-07 3:11
RandyS14-Feb-07 3:11 
GeneralRe: Getting text under the cursor Pin
Mark Salsbery14-Feb-07 6:43
Mark Salsbery14-Feb-07 6:43 
GeneralRe: Getting text under the cursor Pin
Christian Graus14-Feb-07 9:27
protectorChristian Graus14-Feb-07 9:27 
QuestionDisableProcessWindowsGhosting in C++? Pin
Debs*13-Feb-07 11:40
Debs*13-Feb-07 11:40 
QuestionSleep() issues Pin
pblais13-Feb-07 10:17
pblais13-Feb-07 10:17 
AnswerRe: Sleep() issues Pin
Christian Graus13-Feb-07 10:36
protectorChristian Graus13-Feb-07 10:36 
AnswerRe: Sleep() issues Pin
Ravi Bhavnani13-Feb-07 10:42
professionalRavi Bhavnani13-Feb-07 10:42 
AnswerRe: Sleep() issues Pin
Mark Salsbery13-Feb-07 10:48
Mark Salsbery13-Feb-07 10:48 
GeneralRe: Sleep() issues Pin
pblais14-Feb-07 3:00
pblais14-Feb-07 3:00 
GeneralRe: Sleep() issues Pin
Mark Salsbery14-Feb-07 6:05
Mark Salsbery14-Feb-07 6:05 
GeneralRe: Sleep() issues Pin
pblais15-Feb-07 2:37
pblais15-Feb-07 2:37 
AnswerRe: Sleep() issues Pin
Stephen Hewitt13-Feb-07 10:58
Stephen Hewitt13-Feb-07 10:58 
AnswerRe: Sleep() issues Pin
led mike13-Feb-07 11:19
led mike13-Feb-07 11:19 

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.