🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2110

???(Cust.Ctrls DLL using MFC)

#2110
From: U43893
Date: Wed, 18 Nov 1992 02:40
41 lines
2556 bytes
Hello! I am writing a C++ large memory model DLL using MFC for custom
controls. The problem I'm encountering looks very weird to me.
Here is how the problem occurs:
1. In SDK dialog editor I double click my control. That invokes a callback
function BOOL ClassStyle(bla-bla-bla) which I provide. This function does all
necessary routines concerning the style dialog editing and then returns
to the dialog editor TRUE (if CTLSTYLE structure is changed), or FALSE
otherwise. So far, everything is perfectly fine.
2. Then dialog editor is trying to recreate the control (WM_NCCREATE, etc.)
I catch WM_NCCREATE, create the object for the window control and do the proper
subclassing. After subclassing messages go to the message map of the control
object instance. Fine, so far. It can take several more messages. And then,
all of a sudden, the CWnd object associated with the control
 is some how lost. I can  tell that because the application ASSERTs
at line 229 in window.cpp which is:  ASSERT(pWnd != NULL);
The message it was trying to process during several times I codeviewed
the execution was WM_GETMINMAXINFO. However, I am not sure that it is
always the case.

Important things to add:
1. This problem once started to occur, then it went away. Recently I came
back and then disappeared again. Now, it's there, as you can guess. Doesn't
it sound mysterious? In fact, i has been adding stuff to my DLL during
all that time. But, as far as I can understand things, I has not been
touching any parts directly related to the problem.
2. Any normal application can create a dialog box with my control with
no problem. Everything works just fine.
3. Moreover, it works with Windows Maker Professional Dialog Editor. Although,
this editor does not send create messages to the control after its style is
edited.

Maybe, there's something about filling the CTLSTYLE structure which the SDK
dialog editor does not like!? But why then does it work from time to time?

I would really appreciate any opinion and suggestions.
I'll be checking my e-mail for those.
Please send me messages to: shatsky@parsys.eecs.uic.edu

Thanks a lot.

-- Vitaly Shatsky
Technical Details
Message-ID: <92322.204002U43893@uicvm.uic.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u43893

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u43893
Organization: University of Illinois at Chicago
Date: Tue, 17 Nov 1992 20:40:02 CST
From: <U43893@uicvm.uic.edu>
Message-ID: <92322.204002U43893@uicvm.uic.edu>
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: ???(Cust.Ctrls DLL using MFC)
Lines: 41