Click here to Skip to main content
15,898,953 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC CreateEx function crashes program Pin
Cedric Moonen2-Oct-09 3:48
Cedric Moonen2-Oct-09 3:48 
GeneralRe: MFC CreateEx function crashes program Pin
ChrisBuckley2-Oct-09 4:13
ChrisBuckley2-Oct-09 4:13 
GeneralRe: MFC CreateEx function crashes program Pin
transoft2-Oct-09 6:13
transoft2-Oct-09 6:13 
GeneralRe: MFC CreateEx function crashes program Pin
ChrisBuckley2-Oct-09 7:14
ChrisBuckley2-Oct-09 7:14 
GeneralRe: MFC CreateEx function crashes program Pin
transoft2-Oct-09 7:23
transoft2-Oct-09 7:23 
GeneralRe: MFC CreateEx function crashes program Pin
ChrisBuckley2-Oct-09 7:47
ChrisBuckley2-Oct-09 7:47 
GeneralRe: MFC CreateEx function crashes program Pin
transoft2-Oct-09 8:54
transoft2-Oct-09 8:54 
GeneralRe: MFC CreateEx function crashes program Pin
ChrisBuckley5-Oct-09 4:24
ChrisBuckley5-Oct-09 4:24 
transoft wrote:
e you sure that "CreateEx" crashed your software? Like "strcpy" will also crash program because of temp string has not enough buffer.

Could you post your code here?

No, I'm not positive that CreateEx is THE cause, all I know is that the
code crashes before the function ever returns. I had narrowed this down by putting Message Boxes throughout the code and the last one that successfully displayed was immediately before the CreateEx() call.
Here's the code that crashed:

void DialogEditBoxObject_Class::init(CWnd *pParent, CString ctrlText, UINT resourceId)
{
CString tmp;
tmp.Format("%d", nLimit); //nLimit is a class member

//pMyRects are allocated in the constructor and do exist here
CreateEx(WS_EX_CLIENTEDGE, _T("EDIT"), tmp, WS_CHILD | WS_TABSTOP | WS_VISIBLE, *pMyRects[0], pParent, resourceId);

CRect clientRect;
GetClientRect(clientRect);
pMyFont->CreateFont(clientRect.Height(),0,0,0,FONT_HEIGHT(700),0,0,0,
ANSI_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
"arial");
SetFont(pMyFont); //pMyFont was allocated in the constructor

}
GeneralRe: MFC CreateEx function crashes program Pin
Tim Craig3-Oct-09 21:58
Tim Craig3-Oct-09 21:58 
GeneralRe: MFC CreateEx function crashes program Pin
ChrisBuckley5-Oct-09 4:59
ChrisBuckley5-Oct-09 4:59 
QuestionDebug Error - Calling a class member function declared in another file Pin
AntoineBab2-Oct-09 3:14
AntoineBab2-Oct-09 3:14 
QuestionRe: Debug Error - Calling a class member function declared in another file Pin
David Crow2-Oct-09 8:56
David Crow2-Oct-09 8:56 
QuestionBackground Colour of TabControl Pin
Deepak.Prahlad2-Oct-09 3:00
Deepak.Prahlad2-Oct-09 3:00 
AnswerRe: Background Colour of TabControl Pin
Deepak.Prahlad6-Nov-09 21:08
Deepak.Prahlad6-Nov-09 21:08 
Questionhow to pass arguments to createproces() function Pin
WindowsVsLinux2-Oct-09 1:26
WindowsVsLinux2-Oct-09 1:26 
AnswerRe: how to pass arguments to createproces() function Pin
CPallini2-Oct-09 1:57
mveCPallini2-Oct-09 1:57 
GeneralRe: how to pass arguments to createproces() function Pin
WindowsVsLinux2-Oct-09 2:34
WindowsVsLinux2-Oct-09 2:34 
GeneralRe: how to pass arguments to createproces() function Pin
Michael Schubert2-Oct-09 2:39
Michael Schubert2-Oct-09 2:39 
GeneralRe: how to pass arguments to createproces() function Pin
WindowsVsLinux2-Oct-09 2:44
WindowsVsLinux2-Oct-09 2:44 
GeneralRe: how to pass arguments to createproces() function Pin
David Crow2-Oct-09 2:50
David Crow2-Oct-09 2:50 
GeneralRe: how to pass arguments to createproces() function Pin
Michael Schubert2-Oct-09 2:52
Michael Schubert2-Oct-09 2:52 
GeneralRe: how to pass arguments to createproces() function Pin
CPallini2-Oct-09 2:44
mveCPallini2-Oct-09 2:44 
QuestionRe: how to pass arguments to createproces() function Pin
David Crow2-Oct-09 2:21
David Crow2-Oct-09 2:21 
AnswerRe: how to pass arguments to createproces() function Pin
Michael Schubert2-Oct-09 2:33
Michael Schubert2-Oct-09 2:33 
GeneralRe: how to pass arguments to createproces() function Pin
Cedric Moonen2-Oct-09 2:51
Cedric Moonen2-Oct-09 2:51 

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.