Results 1 to 40 of 40

Thread: First Draft of SxS Tutorial, Posted for Review

  1. #1

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    First Draft of SxS Tutorial, Posted for Review

    Okay, I've posted a first draft of my SxS tutorial.

    At the moment, I've got it over in the testing area

    You can post comments/critiques either here or in the testing thread. I'd prefer they were posted here though (and not the testing thread).

    Also, it'd be nice if you'd quote sections in your reply you feel could use improvement.

    Here's the link to the thread.

    I truly look forward to everyone's comments.

    Best Regards,
    Elroy
    Last edited by Elroy; Sep 8th, 2017 at 01:24 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  2. #2
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: First Draft of SxS Tutorial, Posted for Review

    Make an explanation about 'PreferExternalManifest' in the registry.
    This registry entry has importance since Vista+.

  3. #3

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Thanks Krool. Here's what I'm proposing. I'll slip in the following where I'm talking about internal/external manifests.

    Also, as a note, there is a Windows registry flag named PreferExternalManifest. It might be found under the...

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide

    ...registry entry as a DWORD entry. If it's found, it'll just be a 0 or 1 boolean-type entry. If it's there, and set to 1, and you have both an internal and external manifest, the external will be preferred. Also, there are a couple of reports (here and here, etc.) for certain versions of Windows that external manifests won't work currectly unless this PreferExternalManifest flag is set to 1. This is all yet another reason that internal manifests (with no external manifest found) are the superior way to go.

    Krool, do you think that covers it?
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  4. #4
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: First Draft of SxS Tutorial, Posted for Review

    Yes, good.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: First Draft of SxS Tutorial, Posted for Review

    External manifest priority is a security vulnerability. Why even discuss this?

    The "feature" is only there for use by an admin trying to temporarily cope with broken software. Any program that sets this flag is malware.

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

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by dilettante View Post
    External manifest priority is a security vulnerability. Why even discuss this?

    The "feature" is only there for use by an admin trying to temporarily cope with broken software. Any program that sets this flag is malware.
    I'd tend to agree with you regarding the last statement. But as software creators, I'd be a bit lenient with the 1st statement. If our software is failing on the customer's box, knowing the external manifest preference and settings allows another troubleshooting avenue. That information is also nice to know if wanting to make the IDE DPI-aware & themed without hacking vb6.exe resources section. Last but not least, external preference is not really a secret; though maybe not as well known as manifests themselves.
    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}

  7. #7

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Well Dilettante, if you read the tutorial, you'll see that I say things like "internal manifests are strongly preferred" and that "external manifests should just be used for developmental testing". And also, in the above, I stated that, "This is all yet another reason that internal manifests (with no external manifest found) are the superior way to go."

    I think we're fine. And I know full well that you're not a fan of the SxS technology with OCX flies.

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by Elroy View Post
    And I know full well that you're not a fan of the SxS technology with OCX flies.
    I have no idea where you got that notion. I have been working with this since 2004 and posting about it since at least 2006.
    Last edited by dilettante; Sep 8th, 2017 at 06:58 PM.

  9. #9

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    @Dilettante: Hmmm, okay. In that case, I offer an apology. Sorry, I'd just gotten the impression that you were a die-hard for letting an installer deal with the OCX files.

    Take Care,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: First Draft of SxS Tutorial, Posted for Review

    You are mixing apples and oranges. Installers are meant for dealing with a lot more than just registering ActiveX libraries, so you still need them to deal with many other things.

  11. #11
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: First Draft of SxS Tutorial, Posted for Review

    Both things are neccesary: installers and SxS.
    In fact, I combine both: I build an SxS portable version and then makes the installer. And the installer just copies the portable version to \Program files and creates the shorcuts in the start menu (along with other things that an installer can do as setting registry keys), but do not register the OCX/DLL.

    That's my idea of the best currently available approach to deal with DLL hell.

  12. #12
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: First Draft of SxS Tutorial, Posted for Review

    @Elroy, the tutorial seems good so far.

    I have for SSTab and RichTextBox this code and it is working OK, but it has less lines than yours:
    Code:
      <file name="Bin\TabCtl32.Ocx">
        <typelib tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" version="1.1" flags="control" helpdir="" />
        <comClass clsid="{BDC217C5-ED16-11CD-956C-0000C04E4C0A}" tlbid="{BDC217C8-ED16-11CD-956C-0000C04E4C0A}" threadingModel="Apartment" progid="TabDlg.SSTab.1" miscStatusIcon="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,simpleframe,setclientsitefirst" description="A Tabbed Dialog control that can be used to group controls on separate tabs." />
      </file>
      <file name="Bin\richtx32.ocx">
        <typelib tlbid="{3B7C8863-D78F-101B-B9B5-04021C009402}" version="1.2" flags="control" helpdir="" />
        <comClass clsid="{3B7C8860-D78F-101B-B9B5-04021C009402}" tlbid="{3B7C8863-D78F-101B-B9B5-04021C009402}" threadingModel="Apartment" progid="RICHTEXT.RichtextCtrl.1" miscStatusIcon="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst" description="Microsoft Rich Textbox Control 6.0 (SP6)" />
      </file>
    There is nothing about comInterfaceExternalProxyStub there.
    Also you have several comClass clsid and I have only one (for each of these two controls).


  13. #13
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: First Draft of SxS Tutorial, Posted for Review

    @Eduardo: Your manifest is including only progid="TabDlg.SSTab.1" and missing the version independent progid. This might be a problem when using Controls.Add to dynamically load controls on a form.

    @Elroy: The tool you are using to generate sample manifests omits progids altogether. Also including comInterfaceExternalProxyStub for ActiveX controls is an overkill as these are never meant to be used in multi-threading scenarios.

    Another topic worth including is licensed controls. Unfortunately manifests do not allow "overriding" HKLM\Licenses entries, so these have to be extracted from dev machine and handled manually through Licenses collection in case of reg-free usage to prevent nag-screens and similar.

    cheers,
    </wqw>

  14. #14

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Hi wqweto,

    If you don't mind, I'm wondering if you could clear up a couple of your comments. First, you say...

    Quote Originally Posted by wqweto View Post
    ...including comInterfaceExternalProxyStub for ActiveX controls is an overkill as these are never meant to be used in multi-threading scenarios.
    It's my understanding that OCX files are in-process and run on the same thread as the application. Am I wrong about this? Or, are you saying that comInterfaceExternalProxyStub would only be necessary if we were attempting some kind of multi-threading? Also, I'm not sure I mind a bit of overkill, so long as everything works as it should. What's the downside?

    Quote Originally Posted by wqweto View Post
    Unfortunately manifests do not allow "overriding" HKLM\Licenses entries, so these have to be extracted from dev machine and handled manually through Licenses collection in case of reg-free usage to prevent nag-screens and similar.
    That one seems a bit more difficult. I haven't used a control that requires licensing in many years, but I suppose there are a few out there who do. Also, in the few I've explored in years past, it seems that there are several different approaches to the way they go about it. I would hope/assume that any control requiring licensing would detect when it's being used from an executable (whether as SxS or through the registry) and not bother the user with nag screens (and the like). But I have far from absolutely certainty about this.

    I think the best I'll be able to do is to put a caveat in the tutorial about licensed controls, and let people figure that one out on their own.

    Thanks,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  15. #15
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: First Draft of SxS Tutorial, Posted for Review

    For my VBMThread11.DLL library was an comInterfaceExternalProxyStub section necessary in order to work reg-free. I would just say it is an rare case and could be excluded in the tutorial. (?)
    Or just give a small hint that it may be necessary for some ActiveX libraries..

  16. #16
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: First Draft of SxS Tutorial, Posted for Review

    If you have a control instance sited on a Form, UserControl, etc. then the license info is captured by the compiler.

    If you don't, the issues are the same as if you install and register the libraries. See the manual on the Licenses Collection.

  17. #17
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: First Draft of SxS Tutorial, Posted for Review

    Elroy

    As the self-appointed newbie representative, let me mention this thread.

    In it, I found this to be useful
    It is by Karim Wafi, and references LaVolpe's initial opus.

    Re: Calling XP/Vista/Win7 Manifest Creator from VB6 Add-Ins

    Before use it, compile and name the component with ManifestCreator.dll
    Click install.bat for registering the addins file.

    How to use:
    1. In your VB6 Application click Add-Ins menu >> click Manifest Creator menu.
    2. Adjust any settings in the Manifest Creator.
    3. Click Create Manifest button. Finish.

    Well, perhaps I should say "somewhat" useful.
    When I click Add-Ins menu, I don't see Manifest Creator.

    Name:  manifest1.png
Views: 370
Size:  10.0 KB

    • Am I missing something?
    • Is that even something you are assuming is to be done?


    Spoo
    Last edited by Spooman; Sep 11th, 2017 at 04:09 AM.

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

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by Spooman View Post
    As the self-appointed newbie representative, let me mention this thread.

    In it, I found this to be useful
    It is by Karim Wafi, and references LaVolpe's initial opus.

    Spoo
    Personally I wouldn't use that dll unless your only goal is to theme the project. If you look at the BuildManifest function in frmMain, you will see it only adds themes and Vista's Trust Info element. It does not offer any of the other many manifest options. It may have been based off my code, but it was stripped down.

    Edited: That dll also creates an application manifest, not SxS. However, there are notes in that thread to use another tool to create SxS manifests.

    And regarding this statement: "In your VB6 Application click Add-Ins menu >> click Manifest Creator menu." I think he is saying you access the DLL from the menu, not from the Add-Ins dialog. Click on the Add-Ins menu again and see if there is a submenu item: Manifest Creator
    Last edited by LaVolpe; Sep 11th, 2017 at 05:58 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}

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

    Re: First Draft of SxS Tutorial, Posted for Review

    @Elroy. Regarding your tutorial topic: Putting manifests into ActiveX DLL and ActiveX EXE projects.

    I thought that manifests placed in DLL/OCX were to have an ID of 2, not 1? If you could verify and update if needed.
    https://blogs.msdn.microsoft.com/jun...aware_enabled/
    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}

  20. #20
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by LaVolpe View Post
    Click on the Add-Ins menu again and see if there is a submenu item: Manifest Creator
    No, there isn't .. just these ..

    • Visual Data Manager ...
    • Add-In Manager


    Spoo

  21. #21
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    858

    Re: First Draft of SxS Tutorial, Posted for Review

    Don't know if you want to expand you explanation a bit with a little more background but
    you might want to address a little further DLLHell and/or OCX versions. See:
    https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

  22. #22

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Hi All,

    I'm on a consulting gig for the next few days (actually through Sept 20), so, I apologize if I'm not attending to this as much as I have over the last couple of weeks.

    There are several points in the last few posts that I do need to examine/consider.

    However, there's one I'd like to address now:

    Quote Originally Posted by LaVolpe View Post
    I thought that manifests placed in DLL/OCX were to have an ID of 2, not 1? If you could verify and update if needed.
    https://blogs.msdn.microsoft.com/jun...aware_enabled/
    I currently have 6 ActiveX DLLs I use with my primary project, and they all/each use SxS in an internal manifest. In each/all cases, I just use the #24 for the Type and 1 for the ID. All of my installations are set up in a "Portable" way, so I know the SxS is being used, and I've never seen any problem.

    Name:  SxS2.png
Views: 329
Size:  20.9 KB

    I read through your link and didn't really see where it said to use ID=2. Do you have another reference for that?

    Also, when I get a bit more time, I'll test with ID=2 and see if it makes any difference.

    Best Regards,
    Elroy

    EDIT1: Also, I confess that I've never tried to use SxS within an ActiveX EXE (not DLL). Is that maybe where the ID=2 is required?
    Last edited by Elroy; Sep 11th, 2017 at 10:13 AM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  23. #23
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: First Draft of SxS Tutorial, Posted for Review

    that article says to use 2
    if the dll wants private dependencies other than the process default.

  24. #24
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,373

    Re: First Draft of SxS Tutorial, Posted for Review

    RT_MANIFEST (24)
    CREATEPROCESS_MANIFEST_RESOURCE_ID (1)
    ISOLATIONAWARE_MANIFEST_RESOURCE_ID (2)

    The difference is that when you use a manifest with ID 2 for instance in an OCX to link to comctl32.dll version 6 it will be linked to even if your .exe has no manifest.

    MSDN:
    For example, if an dll depends on comctl32.dll version 6.0.0.0. It should have a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID to depend on comctl32.dll version 6.0.0.0, so that even if the process executable wants comctl32.dll version 5.1, the dll itself will still use the right version of comctl32.dll.
    Last edited by Krool; Sep 11th, 2017 at 10:55 AM.

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

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by Elroy View Post
    I currently have 6 ActiveX DLLs I use with my primary project, and they all/each use SxS in an internal manifest. In each/all cases, I just use the #24 for the Type and 1 for the ID. All of my installations are set up in a "Portable" way, so I know the SxS is being used, and I've never seen any problem.

    I read through your link and didn't really see where it said to use ID=2. Do you have another reference for that?
    Per the link I posted
    ISOLATIONAWARE_MANIFEST_RESOURCE_ID is used primarily for DLLs. It should be used if the dll wants private dependencies other than the process default. For example, if an dll depends on comctl32.dll version 6.0.0.0. It should have a resource of type RT_MANIFEST, ID ISOLATIONAWARE_MANIFEST_RESOURCE_ID to depend on comctl32.dll version 6.0.0.0, so that even if the process executable wants comctl32.dll version 5.1, the dll itself will still use the right version of comctl32.dll.
    FYI: ISOLATIONAWARE_MANIFEST_RESOURCE_ID = 2

    I would think that any DLL containing a SxS manifest would want the dependencies it was coded for, otherwise, it wouldn't be using a manifest? That assumption is probably right more times than not because it (the DLL/ocx) can't really know what the main process will be loading.
    Last edited by LaVolpe; Sep 11th, 2017 at 12:38 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}

  26. #26

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by LaVolpe View Post
    I would think that any DLL containing a SxS manifest would want the dependencies it was coded for, otherwise, it wouldn't be using a manifest? That assumption is probably right more times than not because it (the DLL/ocx) can't really know what the main process will be loading.
    Ahhh, ok, I "get" it now. When I've got time, I'll improve the tutorial.

    However, just as a note, that statement isn't true at all for my primary project. Because I want everything to be portable (including the ActiveX DLLs), I use a manifest with SxS in the DLLs. However, I'm totally happy with these DLLs using exactly the same OCX files as are used by the main executable. Also, because I developed the main executables as well as all the DLLs, my DLLs know precisely what OCX files the main process is loading. In fact, I use exactly the same manifest file in both the main executable as I use in the DLLs (with the exception that the manifest for the DLLs doesn't have the "Dependencies" sub-folder redirection in it, because the DLLs are also placed in this Dependencies sub-folder).

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

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

    Re: First Draft of SxS Tutorial, Posted for Review

    Yeah, that may be true for your DLLs. But as a generality, DLLs are self-contained functions/methods. Same can be said for OCX with exception of having a GUI. If they are written to be used in any project without knowing what the related exe is loading, that's were a manifest (type 2) would apply I'd think. Of course, as with your example, DLLs custom made for a specific exe wouldn't apply here; nor would any that aren't relying on specific dependencies.
    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}

  28. #28

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Okay, here's the paragraph I modified to address the issue of ID=2. I think/hope this covers the issue. Also, all of this is in "Advanced" topics.

    Just as another point, you can actually reference the same set of OCX files from your executable as are referenced from within any ActiveX DLL. Just because you have two manifests (one within the executable, and one within the ActiveX DLL), you don't need two sets of OCX files. This is what will happen when the same OCX file is specified in the ActiveX DLL's manifest as is specified in the main executable's manifest. However, there may be times when you want an ActiveX DLL to reference an OCX file (or set of OCX files) that is different from those accessed by your main executable. In these cases, you place the manifest file into the ActiveX DLL project with a Type of #24, but you use an ID=2 rather than ID=1. Also, when you do this, you are responsible for making sure that the ActiveX DLL knows how to find its own set of OCX files. This is a rather technical Microsoft webpage that discusses these issues.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

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

    Re: First Draft of SxS Tutorial, Posted for Review

    Sounds pretty good with one small nitpick... That manifest type applies to both DLLs and OCxs as far as I know.
    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}

  30. #30

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Say Spoo,

    Let me say first that I truly enjoy your enthusiasm for VB6. It's quite refreshing.

    Let me also try and address what I think you're talking about in posts #17 & #20.

    Manifest files are used for many things, and there are several "Manifest Creators" for VB6 projects floating around this (and other) forums. However, with the possible exception of RegSvr42, I don't think there's any other manifest creator that specifically addresses these SxS issues. And it's specifically these SxS issues that the tutorial is all about.

    In other words, I've specifically attempted to limit the scope of the tutorial to these SxS issues. If you have other things you wish to include in a manifest file, that would be in addition to all this SxS stuff.

    Also, I've never seen an Add-In that has much to do with manifests, other than the Resource Editor. And, the Resource Editor is only used to get the manifest file into a VB6 project. The Resource Editor itself has nothing to do with what's actually inside a manifest file.

    I hope that all makes some degree of sense.

    Best Regards,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  31. #31
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: First Draft of SxS Tutorial, Posted for Review

    Elroy

    I hope that all makes some degree of sense.
    Yes, thanks (with emphasis on "some") ..
    As for the enthusiasm factor .. well, with guys like you and LaVolpe around, it's hard not to.,

    Spoo

  32. #32

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Hi Spoo,

    I feel a bit compelled to explain the Resource Editor a bit more. And I apologize if you already know this stuff.

    The Resource Editor (an Add-In that comes with VB6) is a utility that allows you to create a resource file (.RES) that is associated with your VB6 project. Now, many things can go into these resource files, with one of them being a manifest file. However, many other things can go into them as well. In fact, you can just throw all kinds of your own custom stuff into them if you like. Here's a partial screen-shot of all the stuff that's in the resource file of my primary project:

    Name:  res.png
Views: 311
Size:  17.7 KB

    The top entry (#24/1) is the manifest file. All the others are just all kinds of "junk" that I need for my project.

    Now here's what's cool about the resource files (at least, IMHO). You can throw anything you like into these .RES files, and, when you compile your project, they all get wrapped into your executable (the EXE). That way, I don't have to worry about some user fouling up some necessary file that I need. If it's not found, I just dig it out of the executable's resources.

    Take Care,
    Elroy

    EDIT1: Also, you can actually dig the resources out of any executable (or even any DLL, as they can also have resources). There are some good "resource extractor" tools floating around, but it's been a while since I've played with one. It's sort of fun to extract the icons (and other things) out of other programs.
    Last edited by Elroy; Sep 11th, 2017 at 04:45 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  33. #33
    Fanatic Member Spooman's Avatar
    Join Date
    Mar 2017
    Posts
    868

    Re: First Draft of SxS Tutorial, Posted for Review

    Elroy

    A couple of things

    1. Screen-shots are always helpful
    2. No need to apologize .. I did not know

    Spoo

  34. #34

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Quote Originally Posted by LaVolpe View Post
    Sounds pretty good with one small nitpick... That manifest type applies to both DLLs and OCxs as far as I know.
    Ahhh, good point. I sort of neglected OCX projects completely. I've compiled one before, but it's been a long time. Personally, when I've got UserControls I've developed, I typically just include the source code into whatever project needs them, rather than creating an OCX.

    However, I'll make a note in the tutorial. As far as I understand it, the same ideas would go for OCX projects, ActiveX DLL projects, and ActiveX EXE projects. Here's the latest version of that "Advanced Topic" section in the tutorial:

    • Putting manifests into ActiveX DLL and ActiveX EXE projects.

    To be clear, we are not talking about referencing an ActiveX DLL nor an ActiveX EXE with a manifest file. Rather, we're talking about an ActiveX DLL or an ActiveX EXE (or even an ActiveX OCX file you've developed) referencing other OCX files via SxS and a manifest. All three of these project types (ActiveX DLL, ActiveX EXE, and/or OCX) would use a manifest in the same. Because of this, I will just discuss this in terms of an ActiveX DLL that we may be developing.

    We may be developing an ActiveX DLL that makes use of various OCX files and the associated controls on various forms included in the ActiveX DLL. And furthermore, even with this ActiveX DLL, we'd still like to utilize the SxS technology. An ActiveX DLL project can have a resources file just like a standard EXE project. We simply follow all the above instructions, but substitute ActiveX DLL everywhere where we're talking about an executable. When an ActiveX DLL executes, it will look for a manifest (external or internal), just like an executable does. And, if it's there, and there are SxS directives in it about OCX files, it will attempt to find those OCX files. And, if they're not found, that ActiveX DLL will report an error and fail to execute.

    Just as another point, you can actually reference the same set of OCX files from your executable as are referenced from within any ActiveX DLL. Just because you have two manifests (one within the executable, and one within the ActiveX DLL), you don't need two sets of OCX files. This is what will happen when the same OCX file is specified in the ActiveX DLL's manifest as is specified in the main executable's manifest. However, there may be times when you want an ActiveX DLL to reference an OCX file (or set of OCX files) that is different from those accessed by your main executable. In these cases, you place the manifest file into the ActiveX DLL project with a Type of #24, but you use an ID=2 rather than ID=1. Also, when you do this, you are responsible for making sure that the ActiveX DLL knows how to find its own set of OCX files. This is a rather technical Microsoft webpage that discusses these issues.

    If you're careful about the way you do things, you can use the same manifest file for your ActiveX DLLs that you use for your executable. For me, I tend to also place my ActiveX DLL files into my "Dependencies" folder. Therefore, the manifest file that I insert into those ActiveX DLL projects does not have the Dependencies\SomeOcxFile.ocx redirection, because the ActiveX DLL is already in the "Dependencies" folder.

    Once people get the core concepts down (of how a standard EXE would use SxS with an OCX), I suspect much of the rest of this will fall into place for them.

    However, I greatly appreciate the feedback.

    Have a Great Day,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  35. #35
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: First Draft of SxS Tutorial, Posted for Review

    Does anyone here have experience successfully manifesting ActiveX EXE(s) ?

  36. #36

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    Hi Dex,

    I'm certainly willing to be corrected on this, but it's my understanding that you can't use a manifest and SxS to reference an ActiveX EXE. ActiveX EXEs are out-of-process programs, and, it's my understanding that the SxS technology is only for in-process things (i.e. ActiveX DLLs and ActiveX OCXs).

    Take Care,
    Elroy

    EDIT1: However, I know of no problem with an ActiveX EXE using a manifest and SxS to reference other OCXs and/or ActiveX DLLs.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  37. #37
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: First Draft of SxS Tutorial, Posted for Review

    @DEXWERX: VB6 compiled ActiveX EXEs try to self-register on start up even w/o parameter "/regserver" when its registration entries are not present in HKLM. Writing in HKLM nowadays fails in flames if the process is not elevated so the users get an obscure MsgBox and the process terminates.

    Otherwise just running the ActiveX EXE should make its class factories available for out-of-process use by any other local process on the machine. . . provided that HKLM write failure is overcome.

    cheers,
    </wqw>

  38. #38
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: First Draft of SxS Tutorial, Posted for Review

    Thanks! just trying to add to the discussion, and not have any assumptions flying around.

    Trying to establish that you can't use an ActiveX exe in any sort of portable way. (because of the HKLM permissions)
    At least not one created using VB6.

  39. #39

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,853

    Re: First Draft of SxS Tutorial, Posted for Review

    This is good info about an ActiveX EXE's inability to stay away from the registry. I've added the following section under advanced topics in the tutorial:


    • Referencing ActiveX EXEs (or not).

    This topic is just placed here as a note. It is not possible for a standard executable to access an ActiveX EXE through a manifest file and the SxS technology. The SxS technology is primarily designed for in-process references. And an ActiveX EXE runs out-of-process to the other program(s) accessing it. Also, it's probably impossible to include an ActiveX EXE in an overall project that desires to stay entirely portable. The reason for this is that ActiveX EXEs tend to self-register certain information for other processes to use them. It may not be possible to set up a VB6 developed ActiveX EXE in such a way that it stays completely away from the registry.


    Good Stuff, Thanks,
    Elroy
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  40. #40
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: First Draft of SxS Tutorial, Posted for Review

    @elroy Thanks for putting this together!

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