Including .NET assemblies in a VB6 manifest?

I am working on a vb6 project and want to create a manifest, so registration is not required.

I use the MMM tool (Make My Manifest), which scans your VB6 project for dll dependencies and generates a manifest.

However, MMM does not include tlb files, and I have Client.dll and Client.tlb written in .net that were open for COM and used in my VB6 program.

I do not use Regasm, as it would be nice if the registry were not registered.

I tried to generate a separate manifest for the mt tool on the command line: "mt.exe -tlb: Client.tlb -dll: Client.dll -out: Client.manifest"

Then I thought that I could combine manifest 2 with: "mt.exe -manifest program.exe.manifest client.manifest -out: program.exe.manifest"

However, when I run the program, I get a window with the message "Runtime error -2147220999 (800401f9): Automation error, Error in the DLL"

Whether I am doing everything correctly above, someone had a similar experience, any help is appreciated.

+5
source share
1 answer

The following is a brief description of UMMM :

  • Firstly, for dll.Net it generates a temporary file manifest with this

    mt.exe -nologo -managedassemblyname:"{dotnet_dll}" -nodependency -out:"{dotnet_dll}.manifest" 
  • Then inserts this manifest into .Net dll as RT_MANIFEST 2 resource using this

     mt.exe -nologo -manifest "{dotnet_dll}.manifest" -outputresource:"{dotnet_dll}";2 
  • Finally, it references DLL.Net from the VB6 executable, retrieving the assemblyIdentity tag from the .Net dll manifest and adding it to the manifest without regular expressions inside the dependency\dependentAssembly tag, like this

     <dependency> <dependentAssembly> <assemblyIdentity name="PdfSigner" version="1.0.0.0" processorArchitecture="msil" /> </dependentAssembly> </dependency> 

In this way, clrClass tags that mention Hans appear in the built-in .Net dll manifest, and not in the VB6 executable manifest.

+3
source

Source: https://habr.com/ru/post/1395068/


All Articles