Re: Subclassing compilation crash
- From: "Bob Butler" <tiredofit@xxxxxxxxxx>
- Date: Thu, 29 Dec 2005 14:52:42 -0800
<williamerubin@xxxxxxxxxxx> wrote in message
news:1135889665.599373.134030@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> When I try to compile my app (in VB6), it compiles, then writes the
> EXE, and then the VB6 IDE itself crashes.
>
> The EXE that it wrote always seems to be perfectly fine.
>
> I have narrowed the problem down to subclassing - if I turn
> subclassing off, the IDE no longer crashes. Only my main startup
> form is subclassed, and it is an MDI form.
>
> I have read that such problems are often due to not resetting the
> window proc appropriately when the subclassed form unloads. However,
> I do have - and always have had - such code to reset the window proc.
> To check whether or not that code actually executes at the appropriate
> time, I put in some code to pop up message boxes at the following
> points:
>
> (1) MDIForm_Load of the main form
> (2) Setting the window proc to my custom proc
> (3) MDIForm_Unload of the main form
> (4) Setting the window proc back to the default proc
Steps (3) and (4) should be reversed; you should also have code in there to
detect running at design time and, if so, skip steps (2) and (4) --- don't
do the subclassing when running in the IDE
> During normal execution of the compiled program, as well as during
> execution via the VB6 IDE, those four message boxes pop up in that
> order, at the appropriate times, as I would expect.
>
> Moreover, I have verified that I am passing the same HWND to the two
> SetWindowLong calls, and that the proc pointer I am passing to the
> second call is the same one that was returned to me by the first call.
>
> However, during compilation, the first two message boxes pop up just
> after the EXE being written, and then the IDE crash occurs, without
> the other two having popped up (i.e. MDIForm_Unload and resetting the
> window proc do not occur).
Is this in a user control? Code in a 'normal' project wouldn't normally be
run when doing a compilation.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
.
- Follow-Ups:
- Re: Subclassing compilation crash
- From: William E. Rubin
- Re: Subclassing compilation crash
- References:
- Subclassing compilation crash
- From: williamerubin
- Subclassing compilation crash
- Prev by Date: Rockford Lhotka Business Objects model question for VB 6.0
- Next by Date: Re: How to enumerate list of all running processes (or services)
- Previous by thread: Re: Subclassing compilation crash
- Next by thread: Re: Subclassing compilation crash
- Index(es):
Relevant Pages
|