Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. COM components in .NET

COM components in .NET

Scheduled Pinned Locked Moved C#
comcsharpc++dotnetsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andreas X
    wrote on last edited by
    #1

    Hi! I am doing some research about COM. I'm about to implements an application with several external dynamic interfaces that should be able to connect to, to be able to get data and/or set data. The thoughts is to use the OPC standards and as i understand it, most of it is COM related. My questions are: Is it possible to write a COM server in c# AND a COM Client in c# that communicates. I have read about this, but i have found alot of c#->c++ och vice verce. Not a pure .NET -> .NET the reason of why i want this is to create a program with interfaces that could be implemented by managed as well as unmanaged code. I have tried to use the codes from Nick Parker's and Heath Stewart's articles here at codeproject but i could not get it to work. If i use project->add reference, I get that i can not re-import a type library to a CLR assembly, since it was exported from a CLR assembly. if i use the the .NET coclass, as should be similar to QueryInteface(). [ComImport, Guid("B58D7C8C-2E2D-4AA6-8EAF-CF7CB448E353")] class CoClass { } ... I only get: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsApplication3.exe Additional information: COM object with CLSID {B58D7C8C-2E2D-4AA6-8EAF-CF7CB448E353} is either not valid or not registered. Even though this COM object is visible in the OLE/COM obejct viewer and it is searchable in the register. I have tried gacutil.exe regasm.exe regscvr32.exe but nothing changes anything. I have tried to implement a .NET COM server with c++ sucessfully and i have managed to access the system library quartz.dll with .NET implementation. so i'm starting to think that it is not ment to be possible to .NET -> .NET interop. or is it ? appiciate any help thanks Andreas Johansson Software developer ABB Robotics Sweden

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups