Results 1 to 12 of 12

Thread: How to prevent VB from crashing when during subclassing

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    11
    I'm using subclassing to limit the form size in resizing. However, it crashes when I presses the stop button or when I terminate it without giving the message processing control back to VB... is there any way to prevent that?

  2. #2
    Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    53
    Don't press the stop button!

  3. #3
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    Go to the Microsoft downloads site and get Dbgwproc.dll to allow stepping through subclassed code in break mode in the VB IDE.
    (You need to have a registered copy of VB or VStudio)

    Then check out the following site:


    http://www.mvps.org/vbvision/grouped..._Modifications
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Make a ActiveX control do the subclassing for you. Pass the form handle to it and when you press the stop button or in some other way break the execution, you wont crash. Before the final compilation, just remove the activeX and place the subclassing module back in your project.
    Also, if you want i can send the activeX to you.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Guest
    Just remember to close your App the proper way by pressing the X button.

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    WEll usually you don't remember to do that, or sometimes you won't be able to do that and sometimes your app just break at a point and then crash
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Guest
    Once you get into the habit of using the X button instead of stop, it wont be a problem. With regards to breakpoints, you can use a different means of debugging instead such as printing to the Debug Window.

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    No,i mean when your code break on certain errors
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    Guest
    And another thing to keep it from crashing, DO NOT have an END statement in the code. Only an Unload statement.

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Right, try to avoid End even if you don't subclass, unload all objects and forms and it will end automatically or if you start from sub main, unload all objects and exit the procedure or use end.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  11. #11
    Guest
    You can use the SSubTmr.dll from VBAccelerator to subclass with ease.

    I also have a similar QST. I want to know HOW to subclass without it crashing. I may need to debug code because sometimes there's a forced routing. I DON'T want DLLs cluttering my prog, so is there a way to do that WITHOUT the debug crash?

  12. #12
    Guest
    Using the End statement is a shortcut for pressing the Stop button, hence, when you code any App, try to avoid using End.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width