Quote Originally Posted by Elroy View Post
(Associating a Manifest File with a VB6 Project, continued)

You will want to drag your prepared manifest file onto the Resource Editor’s window in just this way. After you’ve done this, you will need to rename its “Type” and “ID”. To do this, double-click the 101 for the manifest file you just added. An “Edit Properties” window will open…

Name:  resed6.png
Views: 41296
Size:  8.0 KB

You must change the “Type” to #24 (the # is essential). And then the ID must be changed to 1 (and it must be numeric). Then hit “OK”, and then save the Resource file…

Name:  resed7.png
Views: 38669
Size:  3.5 KB

Once you save your resource file, it will be associated with your VB6 project. For example, if your project is named MyProject, your resource file will typically be named MyProject.res, and this will be recorded in the project’s VBP file.

Furthermore, when you compile your project, this resource file will be wrapped into the executable.

These resource files can have all kinds of information in them. However, anytime there’s a resource file with a Type of #24 and an ID of 1, the compiled executable will attempt to read and interpret this file as a manifest file.

If all is done correctly, you will be using OCX files that you have specified (with no referencing of the Windows registry), rather than the OCX files found in C:\Windows\System32 (or C:\Windows\SysWOW64).

Also, it's been noted that there may be 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 correctly 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.

And that's about it. Hopefully, I've provided you with all the information you need to use any/all OCX files you use in a SxS way.

Good Luck,
Elroy
Hi Elroy, Thank You for this post,
I couldn't get it to work at first but, I worked out what was wrong, the "Type" and "ID" have to be both encapsulated in quotes, eg. Type = "#24" and ID = "1".
Thank you again.