Re: Subclassing compilation crash



<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..."

.



Relevant Pages

  • Re: VarPtr and passing variables by ref
    ... or the background compilation that is an early ... simply open those files in the IDE. ... This becomes stored 'opcode' within the IDE, The 'text' portion of the code ... that you see in the editor is a 'View' to the underlying pcode. ...
    (microsoft.public.vb.general.discussion)
  • Re: Easier Way to Conditional Compile?
    ... currently running in the IDE or not. ... >> and off with a conditional compilation argument during IDE development. ... >> the app, then go back in and change the value back. ... > then you can test for the underscore character anytime at run time to ...
    (microsoft.public.vb.general.discussion)
  • Re: Remote Compilation
    ... > We would like to know how you use remote compilation. ... IDE copies files through FTP to server. ...
    (comp.lang.cobol)
  • Remote Compilation
    ... We would like to know how you use remote compilation. ... IDE copies files through FTP to server. ...
    (comp.lang.cobol)

Quantcast