COM application portability

This is a discussion on COM application portability within the Windows Programming forums, part of the Platform Specific Boards category; I've done a COM application C-C# under Visual Studio 2008 which works perfect on the development machine. The .exe file ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    58

    COM application portability

    I've done a COM application C-C# under Visual Studio 2008 which works perfect on the development machine. The .exe file can be launched from any folder, no constraint for the tlb and dll files (to be with the exe).
    I moved the exe file to an XP system and got the HRESULT error of class (dll) unregistered (80040154).
    Thanks for any help to allow portability on any machine.

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,538
    COM libraries needs to be registered before use (although there might be ways to use COM-libraries without registration? I cannot remember; you will have to search on that one).
    You need to run regsvr32.exe name_of_com.dll.
    Alternatively, use an installer.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,660
    The visual studio app wizard for COM apps usually include command line support for "/RegServer" and "/UnregServer". Or you can typically run "regsvr32 myapp.exe" on the command line to register COM objects within that module.
    You are also responsible for installing any dependencies of your app that may need to be installed. Like the VS 2008 redistributable package for example.

    gg

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    58
    Thanks! I've forgotten that the .net dll assemblies need regsitration with regasm.exe. Of course, it works. Just for other interested: put the exe and the dll in the same folder, then run from command line > regasm <name>.dll /tlb:<name>.tlb . That's all.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cleanup of the application...
    By Petike in forum Windows Programming
    Replies: 1
    Last Post: 08-16-2008, 05:23 PM
  2. Problem with com application
    By amardon in forum C++ Programming
    Replies: 3
    Last Post: 10-06-2005, 05:50 AM
  3. MFC run application by clicking on file...
    By dug in forum Windows Programming
    Replies: 4
    Last Post: 12-02-2004, 03:33 AM
  4. Win application not very portable
    By swed in forum Windows Programming
    Replies: 5
    Last Post: 10-01-2001, 11:17 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21