Page 2 of 2 FirstFirst 12
Results 41 to 44 of 44

Thread: Unicode caption for form: not working with classic or non-themed mode

  1. #41

    Thread Starter
    Lively Member
    Join Date
    Apr 2015
    Posts
    72

    Re: Unicode caption for form: not working with classic or non-themed mode

    Quote Originally Posted by dilettante View Post
    Programs should never have an End statement.

    In any case the only easy IDE-safe way to handle subclassing is to use a separately compiled DLL that can unsubclass when the class it houses terminates. You could rewrite the subclassing logic as a class in your own DLL or use one provided by somebody else.
    I end up with the clsSubClass by Paul Caton and no crash, just need to remove the Unicode validate line in the class. Anyway thank you very much for your support!
    Last edited by vietnamvodich; Dec 29th, 2017 at 10:50 PM.

  2. #42
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Unicode caption for form: not working with classic or non-themed mode

    Quote Originally Posted by vietnamvodich View Post
    I end up with the clsSubClass by Paul Caton and no crash, just need to remove the Unicode validate line in the class.
    That's because, in a sense, the thunks used by Paul Caton are 'external' and tests for a pause/stop/break in code to help prevent crashes and allow debugging. Using END in an application, in almost all circumstances, is typically the result of poor coding -- not able to shut down the application properly. Subclassing with the older techniques is hazardous in the IDE. If it doesn't crash in IDE, the same exact scenario shouldn't crash when compiled. Any other scenario can still result in a crash after compiling, whether subclassing exists or not, i.e., unhandled errors, buffer overflows, incorrect usage of CopyMemory API, etc.

    Edited: Paul Caton's thunks, IIRC, do not guarantee subclass removal in the proper order. This can be problematic if the same window is subclassed more than once using his thunks or also subclassed outside of your application. The common controls subclassing option offered since at least Win2K take that into consideration. IMO, Caton's solution was ground-breaking at the time and offered VBers mostly-safe subclassing options within the IDE that weren't really available without external DLLs. About the only real advantage to using his thunks nowadays would be for stand-alone classes (class, usercontrol, property page, etc) that do not want a bas module to contain the common controls-type subclassing.
    Last edited by LaVolpe; Dec 30th, 2017 at 01:03 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #43
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Unicode caption for form: not working with classic or non-themed mode

    This was interesting to play with but hardly useful.

    You shouldn't be assigning a caption in Elbonian on a North Elbonian computer anyway.

  4. #44
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,229

    Re: Unicode caption for form: not working with classic or non-themed mode

    Even using a DLL for subclassing can have issues with the END statement. (DbgWProc.DLL for example would reliably crash with End)

    If you use my DLL, you can remove the dependency for release builds. Or if you're lazy you can redist VBSubclass.dll like some people here. Unlike DbgWProc it works both compiled and in the IDE, just with less training wheels. It's possible to not crash in the IDE, and still crash when compiled or without the dependency. But that's true of a lot of apps when debugged anyway, as you're less likely to write to protected memory when debugging.
    Last edited by DEXWERX; Jan 2nd, 2018 at 12:17 PM.

Page 2 of 2 FirstFirst 12

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