Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sorry, it's really FindFirstFile that has the bug! Pin
David Crow4-Dec-03 7:52
David Crow4-Dec-03 7:52 
GeneralRe: Sorry, it's really FindFirstFile that has the bug! Pin
Joe Woodbury4-Dec-03 15:15
professionalJoe Woodbury4-Dec-03 15:15 
GeneralRe: Sorry, it's really FindFirstFile that has the bug! Pin
Anonymous8-Dec-03 22:00
Anonymous8-Dec-03 22:00 
GeneralDDX control access in dialogs Pin
J.B.4-Dec-03 0:29
J.B.4-Dec-03 0:29 
GeneralRe: DDX control access in dialogs Pin
Steve S4-Dec-03 0:34
Steve S4-Dec-03 0:34 
GeneralRe: DDX control access in dialogs Pin
J.B.4-Dec-03 0:56
J.B.4-Dec-03 0:56 
GeneralRe: DDX control access in dialogs Pin
J.B.4-Dec-03 1:16
J.B.4-Dec-03 1:16 
GeneralRe: DDX control access in dialogs Pin
Steve S4-Dec-03 1:25
Steve S4-Dec-03 1:25 
Not quite.

The CStatic itself exists throughout the lifetime of the CMyDlg2 object. However, the window associated with it only exists during DoModal. The crash happens in both cases (before and after) for the same reason, that you're trying to operate on a non-existent window. The CStatic is really only a wrapper, which can exist with or without a window, but without the window it's pretty much useless.

It's better to use either DDX_Text and public members or else use methods that manipulate non-public members safely, and to put 'one-time-only' per dialog stuff into OnInitDialog, where it belongs.

The hard part is remembering that a CWnd (or derived class) is NOT the same as a window. It has to be attached or otherwise associated (via creation or subclassing) with an OS window.

Steve S
GeneralRe: DDX control access in dialogs Pin
David Crow4-Dec-03 6:05
David Crow4-Dec-03 6:05 
Questionmysql connection? Pin
murali_utr4-Dec-03 0:22
murali_utr4-Dec-03 0:22 
AnswerRe: mysql connection? Pin
Prakash Nadar4-Dec-03 4:42
Prakash Nadar4-Dec-03 4:42 
AnswerRe: mysql connection? Pin
BaldwinMartin4-Dec-03 5:22
BaldwinMartin4-Dec-03 5:22 
GeneralWindows Add/Remove programs dialog Pin
Shah Shehpori3-Dec-03 23:14
sussShah Shehpori3-Dec-03 23:14 
GeneralRe: Windows Add/Remove programs dialog Pin
Mike Dimmick4-Dec-03 2:50
Mike Dimmick4-Dec-03 2:50 
GeneralHelp me please!!! Deconvolution Pin
Angeluna3-Dec-03 23:12
sussAngeluna3-Dec-03 23:12 
Generalhex to decimal Pin
styve3-Dec-03 22:13
styve3-Dec-03 22:13 
GeneralRe: hex to decimal Pin
murali_utr3-Dec-03 22:22
murali_utr3-Dec-03 22:22 
Generalcystal report problem. Pin
murali_utr3-Dec-03 21:36
murali_utr3-Dec-03 21:36 
GeneralRe: cystal report problem. Pin
murali_utr3-Dec-03 23:41
murali_utr3-Dec-03 23:41 
GeneralGetClipBox Pin
R. Thomas3-Dec-03 21:27
R. Thomas3-Dec-03 21:27 
GeneralRe: GetClipBox Pin
Monty24-Dec-03 1:59
Monty24-Dec-03 1:59 
GeneralRe: GetClipBox Pin
KaЯl4-Dec-03 11:34
KaЯl4-Dec-03 11:34 
GeneralRe: GetClipBox Pin
R. Thomas4-Dec-03 15:38
R. Thomas4-Dec-03 15:38 
GeneralRe: GetClipBox Pin
KaЯl4-Dec-03 21:24
KaЯl4-Dec-03 21:24 
GeneralRe: GetClipBox Pin
R. Thomas7-Dec-03 4:51
R. Thomas7-Dec-03 4: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.