I was not minitoring the mailing list, so I missed the latest replies. Phil's description of how InstallShield uses regasm is correct. Anyway, I have resolved my original quesiton about CreateObject a couple weeks ago. It is really just a COM early-binding versus late-binding issue. I ended up using the regular .NET COM interop C++ methodology by adding explicit interface, importing the type library, calling CoCreateInstance, adding the registry entries to the installer component, etc. Thanks everyone who offered advice.
>-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of WenWu Ru >Sent: 09 November 2006 15:59 >To: wix-users@lists.sourceforge.net >Subject: [WiX-users] CreateObject in C++ for .NET COM interop? > >Our installer includes a .NET assembly component MyCustomActions.dll, which >is marked with !0.NET COM interop!1 in InstallShield. At installation, >InstallShield runs "regasm MyCustomActions.dll /regfile MyCustomActions.reg >/Codebase" to create registry entries on the target system to allow COM >objects to call the .NET assembly. MyCustomActions.dll assembly contains a >class that is derived from System.ComponentModel.Component and is marked >with [ComVisible(true)]. A few custom actions written in InstallScript >calls CreateObject to create an object instance and invokes the functions. >For example: > > set ojb = CreateObject("MyCustomActions.TestClass1"); > result = obj.TestMethod1(); > >Now that I am converting it to WIX, I need to write the equivalent code in >C++ for CreateObject. From what I understand, I need to import the type >library for MyCustomActions.dll and create an interface pointer with >CoCreateInstance. However, MyCustomActions.dll assembly does not >explicitly >declare any interface, and currently no type library is created in the >build >or install process. How does CreateObject create the instance and invoke >the method? I am hoping that I do not have to modify the source code and >build script for MyCustomActions.dll. > >Thanks, >-WenWu >P.S. Instead of importing the type library, another idea I tried but >failed >is to import the ProgID, e.g. #import "MyCustomActions.TestClass1". Maybe >I >am not using the correct import attributes? > >_________________________________________________________________ >All-in-one security and maintenance for your PC. Get a free 90-day trial! >http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://www >.windowsonecare.com/?sc_cid=msn_hotmail > > > _________________________________________________________________ Share your latest news with your friends with the Windows Live Spaces friends module. http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users