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

C / C++ / MFC

 
GeneralRe: Crazy char-array Pin
Manfred Staiger8-Jun-04 2:01
Manfred Staiger8-Jun-04 2:01 
GeneralRe: Crazy char-array Pin
David Crow8-Jun-04 2:34
David Crow8-Jun-04 2:34 
GeneralRe: Crazy char-array Pin
John R. Shaw8-Jun-04 17:57
John R. Shaw8-Jun-04 17:57 
GeneralRe: Crazy char-array Pin
David Crow9-Jun-04 2:18
David Crow9-Jun-04 2:18 
GeneralRe: Crazy char-array Pin
Gadjuka8-Jun-04 2:11
Gadjuka8-Jun-04 2:11 
QuestionHow could I get main window handle in CDocument? Pin
chenbuaa8-Jun-04 0:52
chenbuaa8-Jun-04 0:52 
AnswerRe: How could I get main window handle in CDocument? Pin
Manfred Staiger8-Jun-04 1:22
Manfred Staiger8-Jun-04 1:22 
AnswerRe: How could I get main window handle in CDocument? Pin
Andrew Quinn AUS8-Jun-04 1:28
Andrew Quinn AUS8-Jun-04 1:28 
Hi there,

Because the MainFrame isn't the active window yet - AfxGetMainWnd will return a NULL pointer in which you use without testing.

Why is it that you are initialising your object with the Main window anyway? The object can use the AfxGetMainWnd when it needs access without you setting the value in the constructor. If you are setting the object to use a particular HWND, then set it to NULL in the constructor, then when the object needs the HWND test if it's NULL - if yes then perform AfxGetMainWnd otherwise use the HWND it has.

Hope this helps,
Andy
GeneralActiveX Controls Pin
sweep1238-Jun-04 0:43
sweep1238-Jun-04 0:43 
GeneralRe: ActiveX Controls Pin
Cedric Moonen8-Jun-04 1:14
Cedric Moonen8-Jun-04 1:14 
GeneralRe: ActiveX Controls Pin
sweep1238-Jun-04 5:12
sweep1238-Jun-04 5:12 
GeneralWindows Platform SDK Pin
guy20048-Jun-04 0:36
guy20048-Jun-04 0:36 
GeneralRe: Windows Platform SDK Pin
GuimaSun8-Jun-04 3:25
GuimaSun8-Jun-04 3:25 
GeneralRe: Windows Platform SDK Pin
Diddy10-Jun-04 2:56
Diddy10-Jun-04 2:56 
GeneralRe: Windows Platform SDK Pin
Diddy8-Jun-04 3:27
Diddy8-Jun-04 3:27 
GeneralFinding process genereating ARP reuquests Pin
abdul moeed7-Jun-04 23:46
abdul moeed7-Jun-04 23:46 
GeneralService Running on a Port Pin
abdul moeed7-Jun-04 23:43
abdul moeed7-Jun-04 23:43 
GeneralRemoving a monitor program Pin
Shree7-Jun-04 23:43
Shree7-Jun-04 23:43 
GeneralExecutable's Name Pin
ShankarPS7-Jun-04 23:30
ShankarPS7-Jun-04 23:30 
GeneralRe: Executable's Name Pin
Member 1624627-Jun-04 23:33
Member 1624627-Jun-04 23:33 
GeneralRe: Executable's Name Pin
ShankarPS8-Jun-04 1:25
ShankarPS8-Jun-04 1:25 
GeneralRe: Executable's Name Pin
Blake Miller9-Jun-04 4:11
Blake Miller9-Jun-04 4:11 
GeneralFail to initialise a CView derived view within a Splitter Window Pin
Seve Ho7-Jun-04 23:13
Seve Ho7-Jun-04 23:13 
GeneralRe: Fail to initialise a CView derived view within a Splitter Window Pin
Seve Ho7-Jun-04 23:50
Seve Ho7-Jun-04 23:50 
GeneralRe: Fail to initialise a CView derived view within a Splitter Window Pin
Andrew Quinn AUS8-Jun-04 0:26
Andrew Quinn AUS8-Jun-04 0:26 

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.