COM – Generating a manifest file for COM isolation(registry free)

In order to load COM dll without searching from system registry key, application should include the manifest file in resource so that the application can create an instance of COM object from the specified file directly.

After including this manifest file in your compilation(actually, linking time), it will create the Manifest resouce in your executable application.

.NET COM dll example

mt.exe -tlb:MyComNet.dll  -dll:MyComNet.dll -dependency -out:c:\temp\MyComNet.manifest

C++ COM dll example

mt.exe -tlb:MyComCpp.dll  -dll:MyComCpp.dll -out:c:\temp\MyComCpp.manifest

If application depends on two dll(one from .NET and one from C++), you can merge the result in one manifest file. After merging, you can verify the result with the following command.

mt -manifest Merged.manifest -validate_manifest
Advertisements
This entry was posted in Programming and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s