CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2002
    Location
    St.Petersburg Russia
    Posts
    4

    Question Error while adding reference on COM+ object created in C#

    Hello

    I 've written COM+ librart within C#.
    Then, when i try to add reference on it to my C# application
    I get error message:

    " A reference to "MyLib" could not be added. Converting the library to .NET assembly failed. Type library MyLib was exportrd from CLR assembly and can'not be re-imported to CLR assembly"



    What does it mean?
    To use COM+ in C# I need write library in C++ 6.0 ?
    or C# have alternative mechanism of remote using DLLs ?

    Help me plz
    Nicker

  2. #2
    Join Date
    Oct 1999
    Location
    Colorado
    Posts
    288
    in .NET you would write a custom server side control or a library not a COM.... .NET is supposed to get rid of COM even thogh it has COM support....if you want to make it a COM object instead of a library or server side control then yes you would have to write it in C++ 6.0

  3. #3
    Join Date
    Sep 2002
    Location
    St.Petersburg Russia
    Posts
    4

    Exclamation

    So, as I understood, C# does not support COM+.

    But .NET objects (and C# remoting objects) must present
    at server and at client side of object oriented system.

    And there is not any new way of remote object control

    According afore mentioned, C# is less object oriented
    language then C++.

    Please, correct me if that is wrong.
    Nicker

  4. #4
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    265
    Originally posted by Alex Cherviakov
    According afore mentioned, C# is less object oriented
    language then C++.
    That was a good joke. Ha ha.

    To me it seems like you have created a CCW(COM Callable Wrapper) for a C# object, and then tried to reference that wrapper from C#. C# can both use and create COM objects, but if you are going to be using it from C# anyway, why bother creating a COM object?

  5. #5
    Join Date
    Sep 2002
    Location
    St.Petersburg Russia
    Posts
    4

    Thumbs down

    C# support COM objects by using CWW and can create its
    analog, named .NET objects.That's obviously.

    But problem is C# unable to create COM+ or DCOM object
    analogues. And remoted C# client must have whole (large and
    oft alterable) set of object libraries....Very bad!

    Where solution of the problem?
    Using HTTTP and XML ... Much oft that's inconvenied and
    hard in use.

    What else?
    Nicker

  6. #6
    Join Date
    Jul 2000
    Location
    Hawaii
    Posts
    281
    Natively .NET does not use COM technology but instead uses assemblies. This is the recommended way to go if you have a choice.

    However you are able to build ActiveX dlls or COM components in VB.NET by using the COM interop services. You need to create a new VB.NET project using the Class Library project type.
    Then you need to check the 'Register for COM Interop' box somewhere in the project properties.
    Then use the ComClass attribute to create the COM object. There is a tutorial which explains this in detail in MSDN - search for COM Interop and you should find what you need.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured