Click here to Skip to main content
15,886,032 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get file length of file without using CFile::end.. Pin
Dave Bryant23-Jun-03 11:18
Dave Bryant23-Jun-03 11:18 
GeneralThanks Dave, perfect!! Pin
IrishSonic23-Jun-03 11:53
IrishSonic23-Jun-03 11:53 
AnswerRe: How to get file length of file without using CFile::end.. Pin
basementman23-Jun-03 13:23
basementman23-Jun-03 13:23 
AnswerRe: How to get file length of file without using CFile::end.. Pin
Anonymous24-Jun-03 5:42
Anonymous24-Jun-03 5:42 
GeneralProblems with drop down box Pin
Tom Wright23-Jun-03 10:58
Tom Wright23-Jun-03 10:58 
GeneralRe: Problems with drop down box Pin
Dave Bryant23-Jun-03 11:16
Dave Bryant23-Jun-03 11:16 
GeneralRe: Problems with drop down box Pin
Tom Wright23-Jun-03 11:25
Tom Wright23-Jun-03 11:25 
GeneralRe: Problems with drop down box Pin
Dave Bryant23-Jun-03 11:29
Dave Bryant23-Jun-03 11:29 
What's probably happening is that your string is longer than 3 characters, and so the assertion is warning you that you are overwriting memory that you shouldn't.

You need to allocate enough memory to hold the entire string:

CString sTmp;
m_CBAgencyList.GetWindowText( sTmp );
char* pszAgency = new char[sTmp.GetLength()+1];
strcpy( pszAgency, sTmp );

// Do something with pszAgency

delete[] pszAgency;

Dave
http://www.cloudsofheaven.org
GeneralRe: Problems with drop down box Pin
Tom Wright23-Jun-03 11:34
Tom Wright23-Jun-03 11:34 
GeneralRe: Problems with drop down box Pin
Dave Bryant23-Jun-03 11:38
Dave Bryant23-Jun-03 11:38 
GeneralRe: Problems with drop down box Pin
Tom Wright23-Jun-03 11:54
Tom Wright23-Jun-03 11:54 
GeneralRe: Problems with drop down box Pin
basementman23-Jun-03 16:26
basementman23-Jun-03 16:26 
GeneralRe: Problems with drop down box Pin
Dave Bryant23-Jun-03 16:31
Dave Bryant23-Jun-03 16:31 
GeneralMAPI Pin
act_x23-Jun-03 10:07
act_x23-Jun-03 10:07 
GeneralRe: MAPI Pin
David Crow23-Jun-03 10:24
David Crow23-Jun-03 10:24 
GeneralMFC & ATL + Netware problem Pin
Brian Shifrin23-Jun-03 9:56
Brian Shifrin23-Jun-03 9:56 
GeneralDo you know HLP95EN.DLL Pin
algruber23-Jun-03 9:51
algruber23-Jun-03 9:51 
GeneralModeless MFC dialog problem in Winamp plugin dll Pin
Member 34159623-Jun-03 9:23
Member 34159623-Jun-03 9:23 
GeneralModifying WM_COMMAND to another app Pin
Fahr23-Jun-03 8:08
Fahr23-Jun-03 8:08 
GeneralFocus notification Pin
Atlence23-Jun-03 8:06
Atlence23-Jun-03 8:06 
GeneralRe: Focus notification Pin
Neville Franks23-Jun-03 11:35
Neville Franks23-Jun-03 11:35 
GeneralRe: Focus notification Pin
Atlence23-Jun-03 21:07
Atlence23-Jun-03 21:07 
GeneralRe: Focus notification Pin
Neville Franks23-Jun-03 23:26
Neville Franks23-Jun-03 23:26 
GeneralRe: Focus notification Pin
Atlence24-Jun-03 0:45
Atlence24-Jun-03 0:45 
GeneralRe: Focus notification Pin
Neville Franks24-Jun-03 12:07
Neville Franks24-Jun-03 12:07 

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.