tags:

views:

49

answers:

1

I'm trying to get the Registration-Free Activation of COM Components: A Walkthrough sample from Microsoft to run on a windows 7 Professional / 64bit machine. I've downloaded the demo program MSDNRegFreeCOM.msi.

I have it building and running correctly on my XP-32 dev box using VS2008SP1. But when I copy working 32bit demo program to my windows 7 machine, it fails with an 0x80040154 error. This error means that the class is unregistered. However, not explicitly registering this object with windows is the point of this particular com object, so please do not tell me to register this object with Windows.

Is anyone aware of anything special that has to be done with this for windows 7?


EDIT Per Cristian Adam comments below, I've been using an external manifest file (client.exe.manifest). However, when I copy the one from the example, it does not work for me. The code is -

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" 
       manifestVersion="1.0">
       <assemblyIdentity
           type = "win32"
           name = "client"
           version = "1.0.0.0" />
     <dependency>
        <dependentAssembly>
                    <assemblyIdentity
                         type="win32"
                         name="SideBySide"
                         version="1.0.0.0" />
        </dependentAssembly>
     </dependency>
 </assembly>
+1  A: 

Windows 7 reads the internal manifest file first and the external manifest secondly. Windows XP does the other way around.

http://blogs.msdn.com/b/junfeng/archive/2009/05/11/internal-manifest-vs-external-manifest.aspx

Merging an external manifest into the internal manifest can be done by running (in a "Visual Studio 2008 Command Prompt" window):

mt.exe -nologo -manifest client.exe.manifest -updateresource:"client.exe;#1"

Cristian Adam
That's true, but if I don't include the external manifest, it should still read the internal one and load the com object the same as on my XP dev box.
photo_tom
Just tried "Registration-Free Activation of COM-Based Components\deployed\client.exe" on Windows 7 and it worked. Client.exe doesn't have any internal manifest, only the external one.
Cristian Adam
THAT'S GREAT. However, I'm still missing something really simple in the client.exe.manifest file. I've copied the file contents from the example and still cannot get it to load. Could you upload yours?
photo_tom
See how it works when you merge the two manifest files, just tested with a VS2008 compiled version on Windows 7.
Cristian Adam
Just figured it out, thanks for help.
photo_tom