1 year ago

#358803

test-img

Pixtar

OCX reg-free-com process with manifests

I've a third-party lib (DLLs and a OCX) and my own app (EXE and DLLs).

Problem: Version 1.0 of my app uses lib version 1.0 and my app version 2.1 uses lib version 1.4. Both lib versions are not binary-safe. If a user has installed both app versions, only one could work, because only the last lib/ocx is registered.

Now I heard of the reg-free-com process using manifest files: https://learn.microsoft.com/en-us/previous-versions/dotnet/articles/ms973913(v=msdn.10)?redirectedfrom=MSDN

What I've done so far to have both app versions work with different libs/ocx files.

I've created a manifest file for my app: MyApp.exe.manifest

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <assemblyIdentity name="Comp.MyApp" processorArchitecture="X86" type="win32" version="1.0" />
    <description>MyApp</description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
              <assemblyIdentity
                  type="win32"
                  name="GrinderLib.sxs"
                  version="1.0.0.0" />
        </dependentAssembly>
    </dependency>
</assembly>

Beside this one I've created the: GrinderLib.sxs

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

    <assemblyIdentity
        type="win32"
        name="GrinderLib.sxs"
        version="1.0.0.0" />

    <file name="C:\\GrinderLib\\Grinder.ocx">
        <comClass clsid="{E142C57C-55A3-4AD4-A14C-575D99574B79}" tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD31}" description="Grinder Control"></comClass>
        <comClass clsid="{E142C57C-55A3-4AD4-A14C-575D99574B80}" tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD32}" description="Grinder" threadingModel="Apartment"></comClass>
        <typelib tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD32}" resourceid="2" version="1.8" helpdir=""></typelib>
    </file>
    <comInterfaceExternalProxyStub name="_GrinderView" iid="{E9C8BE74-3AE3-408C-8489-DE27B364DE85}" tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD32}" proxyStubClsid32="{00030420-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
    <comInterfaceExternalProxyStub name="_GrinderViewEvents" iid="{D0A38C7D-B0D9-4FB2-B30A-F26169E9828C}" tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD32}" proxyStubClsid32="{00030420-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
    <comInterfaceExternalProxyStub name="_GrinderViewg" iid="{E9C8BE74-3AE3-408C-8489-DE27B364DE86}" tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD32}" proxyStubClsid32="{00030420-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
    <comInterfaceExternalProxyStub name="_GrinderViewEventsg" iid="{D0A38C7D-B0D9-4FB2-B30A-F26169E9828D}" tlbid="{4A97AB7A-66EA-47FC-A420-FD83D1A7DD32}" proxyStubClsid32="{00030420-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>

</assembly>

Note: The manifest main content of GrinderLib.sxs was generated by using mt.exe of the Windows SDK.

I've removed the OCX registration Regsvr32 /u Grinder.ocx from the registry, to try, if the manifests are working.

Currently this attempt isn't working. What am I missing?

dynamic

com

manifest

regedit

ocx

0 Answers

Your Answer

Accepted video resources