Click here to Skip to main content
15,906,574 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSource Code creating Static Control at RunTime Pin
a_david1236-Jul-05 21:08
a_david1236-Jul-05 21:08 
GeneralRe: Source Code creating Static Control at RunTime Pin
Stlan6-Jul-05 22:34
Stlan6-Jul-05 22:34 
GeneralPlease help me! Pin
dSolariuM6-Jul-05 21:08
dSolariuM6-Jul-05 21:08 
GeneralSource Code creating Static Control at RunTime Pin
a_david1236-Jul-05 21:05
a_david1236-Jul-05 21:05 
GeneralRun-Time Check Failure #2 [edited] Pin
toxcct6-Jul-05 20:16
toxcct6-Jul-05 20:16 
GeneralRe: Run-Time Check Failure #2 Pin
Bob Stanneveld6-Jul-05 21:09
Bob Stanneveld6-Jul-05 21:09 
GeneralRe: Run-Time Check Failure #2 Pin
toxcct7-Jul-05 0:18
toxcct7-Jul-05 0:18 
GeneralRe: Run-Time Check Failure #2 Pin
Bob Stanneveld7-Jul-05 0:26
Bob Stanneveld7-Jul-05 0:26 
toxcct wrote:
i do ::strcpy(m_strEditorVersion, EditorVersion); because m_strEditorVersion is defined as a char[10]...
so, the code you suggest me with ReleaseBuffer() won't be able to work...


Your naming convention is a little bit misleading. m_strEditorVersion suggests that is is a normal string instead of a C-Style string. Use m_pszEditorVersion instead.

Back to the problem. Did you check the length of the EditorVersion string? You are just copying the string without length checking. This is a horrible mistake! You should use ::strncpy and copy up to 10 characters if you don't care about the '\0' or only 9 and set the NULL-terminator yourself. I'm almost 100% sure that this solves your problem.

Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralRe: Run-Time Check Failure #2 [edited] Pin
toxcct7-Jul-05 0:31
toxcct7-Jul-05 0:31 
GeneralRe: Run-Time Check Failure #2 Pin
Bob Stanneveld7-Jul-05 0:32
Bob Stanneveld7-Jul-05 0:32 
GeneralRe: Run-Time Check Failure #2 Pin
toxcct7-Jul-05 5:32
toxcct7-Jul-05 5:32 
GeneralRe: Run-Time Check Failure #2 Pin
Bob Stanneveld7-Jul-05 5:45
Bob Stanneveld7-Jul-05 5:45 
Questionhow to uninstall U disk Pin
6-Jul-05 18:35
suss6-Jul-05 18:35 
AnswerRe: how to uninstall U disk Pin
David Crow7-Jul-05 5:07
David Crow7-Jul-05 5:07 
Generalswitch() function Pin
Anonymous6-Jul-05 18:35
Anonymous6-Jul-05 18:35 
GeneralRe: switch() function Pin
khan++6-Jul-05 19:22
khan++6-Jul-05 19:22 
GeneralRe: switch() function Pin
Bob Stanneveld6-Jul-05 20:44
Bob Stanneveld6-Jul-05 20:44 
GeneralRe: switch() function Pin
Anonymous7-Jul-05 8:18
Anonymous7-Jul-05 8:18 
GeneralRe: switch() function Pin
Bob Stanneveld7-Jul-05 19:51
Bob Stanneveld7-Jul-05 19:51 
GeneralRe: switch() function Pin
Maximilien7-Jul-05 0:38
Maximilien7-Jul-05 0:38 
Questionhow to use mfc in win32 dll? Pin
gohappy_19996-Jul-05 18:05
gohappy_19996-Jul-05 18:05 
AnswerRe: how to use mfc in win32 dll? Pin
ThatsAlok6-Jul-05 20:23
ThatsAlok6-Jul-05 20:23 
GeneralVARIANT/COM Hell Pin
Christian Graus6-Jul-05 17:03
protectorChristian Graus6-Jul-05 17:03 
GeneralRe: VARIANT/COM Hell Pin
Jose Lamas Rios7-Jul-05 7:46
Jose Lamas Rios7-Jul-05 7:46 
GeneralRe: VARIANT/COM Hell Pin
Christian Graus7-Jul-05 13:15
protectorChristian Graus7-Jul-05 13:15 

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.