none
Com Interop with a .Net Application RRS feed

  • Question

  • Hello!

    Is it possible, to have a C++/CLR project compiled as an application, und expose some classes through Com-Interop to Com-Clients?

    I want to run an application, but let some Com/DCom-Clients (alongside with a local user) take control of that application

    I've tried to make a new Visual C++ CLR Console Application (Visual Studio 2005), define a class and make it com-visible, same procedure, same class as with generating a Class Library, but when I try to register it with regasm, he throws out the following error message:

    Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42
    Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.

    RegAsm : error RA0000 : Attempt to load an unverifiable executable with fixups (
    IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x8013
    1019)

    The assembly has a strong name

    Everything goes right with a Dll, but not with an application

    Does anyone have an idea?

    Sincerely

    Hans Juergen

    Wednesday, January 24, 2007 3:48 PM

Answers

  • 

    Hello!

    Is it possible, to have a C++/CLR project compiled as an application, und expose some classes through Com-Interop to Com-Clients?

    I want to run an application, but let some Com/DCom-Clients (alongside with a local user) take control of that application

    I've tried to make a new Visual C++ CLR Console Application (Visual Studio 2005), define a class and make it com-visible, same procedure, same class as with generating a Class Library, but when I try to register it with regasm, he throws out the following error message:

    Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42
    Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

    RegAsm : error RA0000 : Attempt to load an unverifiable executable with fixups (
    IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0x8013
    1019)

    The assembly has a strong name

    Everything goes right with a Dll, but not with an application

    Does anyone have an idea?

    Sincerely

    Hans Juergen

    Don't do this (or don't try), expose your .NET classes as COM+ "server" type applications. That means, let your class derive from ComponentServices (see System.EnterpriseServices) and build a DLL i.s.o an exe. When done register your assembly with the COM+ catalog using regsvcs.exe.
    Both native COM and .NET clients can now access the out-proc COM server with all the added benefits of COM+.
     
    Willy.
     
     
    Wednesday, January 24, 2007 8:59 PM