dcsimg
Results 1 to 9 of 9
  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2018
    Posts
    31

    Follow-up on Binary Compatibility

    I've been able to successfully implement Binary-Compatibility to prevent Class ID changes between object compilations. I reviewed the conditions under which compatibility will fail.

    In summary, as I understand it, binary-compatibility will be maintained between compilations if the public interfaces (properties, functions and subroutines) to an object remain unchanged. Changes would include names of the properties, functions and subroutines, and the number and names of arguments to functions and subroutines.

    The question to the forum; is the summary correct?

    Please advise as to corrections.

    Thanks, Mickey

  2. #2
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,995

    Re: Follow-up on Binary Compatibility

    That's correct as far as I know. Unfortunately I think this includes public enumerations too. Although I wonder if there's ways around that.
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    17,326

    Re: Follow-up on Binary Compatibility

    Quote Originally Posted by MickeyXm View Post
    The question to the forum; is the summary correct?
    Yes. If including public UDT (type defs), can't change those either (applies to DLL, OCX). I also believe that changing public enumerations is a restriction. If others chime in and say I'm wrong, then so be it and ignore the last paragraph below.

    In short, need to tweak a public method signature: don't. Instead, create a new public method like Microsoft often does, appending Ex or 2 or something else to the name. Example. Navigate2 in the IWebBrowser class

    If you want to add more items to an enumeration, create a new enumeration with just the new items or copy all the items from a previous enumeration, changing their names slightly, then add the new items.

    Edited: Dex beat me to it, regarding enums
    Last edited by LaVolpe; Jul 9th, 2018 at 09:15 AM.
    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}

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2018
    Posts
    31

    Re: Follow-up on Binary Compatibility

    Thanks for all the great input; I'll add enumerations to the list.

    One other thing, if after a compilation, compatibility fails does the IDE create a new Class ID immediately, or does it allow for corrections to be made; if for example, a public element was mistakenly changed?

    Additionally, assuming a new Class ID is created, if the mistake is corrected and compatibility is restored, does the original Class ID come back into effect?
    Last edited by MickeyXm; Jul 9th, 2018 at 09:39 AM.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,675

    Re: Follow-up on Binary Compatibility

    If you do something to break compatibility, you will know when you compile. The compiler will let you know. It will be painfully obvious. And since the compile failed, no new ClassID will have been created.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    621

    Re: Follow-up on Binary Compatibility

    If a build is going to break Binary compatibility, VB will tell you so before it does so.

    If I recall correctly, it offers you the change to break compatibility, or "downgrade" it to "Project" Compatibility (although I never really got my head around what that one does) or to cancel because, as you say, you may well have done something by mistake.

    As far as I know, there is no way to "recover" the previously used Class ID[s], Interface ID[s] and Type Library ID[s] involved; all being GUIDs, once they're changed, they're changed for good.

    Regards, Phill W.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    18,917

    Re: Follow-up on Binary Compatibility

    Type libraries have a LIBID and Major & Minor versions that are significant as well.

    Once again I suggest you look at the SyncCmpt IDE add-in and the document that comes with it.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2018
    Posts
    31

    Re: Follow-up on Binary Compatibility

    Thanks again for all the great information. I was hoping the compiler, on detecting the binary mismatch would not only flag it, but not create a new binary and hence a new Class ID.

    BTW: If you've had a lot of clutter built up in the Registry of extraneous classes, prior to using binary compatibility, I've found it convenient to temporally rename the project folder, then run a Registry cleaner (I've used GlarySoft, now Glary Utilities with great success). This will remove all the extraneous Class ID's. Then all you need to do is name the project folder back to the original, and recompile the ActiveX, and re-reference the client. Perhaps this is a well known procedure.

  9. #9
    Fanatic Member
    Join Date
    Jan 2013
    Posts
    621

    Re: Follow-up on Binary Compatibility

    > "I was hoping the compiler ... would not only flag it, but not create a new binary and hence a new Class ID."

    That is how it behaves.

    See this posting for a sample of the warning dialog that it displays before breaking everything. (The Poster's issue is different - it's just the image I'm interested in).

    Regards, Phill W.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width