none
How to Register/Revoke/Access an object through the Running Object Table RRS feed

  • Question

  • Documentation on this seems to be poor at best.  I've seen a couple examples, but they're each different from the next and none of them seem to work when I test it.  I'm trying to get a better handle on how to register objects with the ROT and then access the instance in another application.  To be honest I'm trying to wrap my mind around the whole concept and would like a practical example to go by.  Just for testing purposes I'm trying to create an example I can use to learn from that defines the object in a .NET (c#) project (provider), and then the consumer will also be a .NET (c#) project.  I know I should be able to access this in VB with GetObject(), but I'm really just looking for sample code and seeing it work correctly in the .NET environment for the consumer should help me better understand what it should look like on this end.  I've learned a lot with .NET over the last couple years but have very little experience on this end.  Any examples known of or available would be greatly appreciated.

    Jason

    Tuesday, January 20, 2015 5:54 PM

Answers

  • Marshal.GetActiveObject is the .Net wrapper of the GetActiveObject API which is exposed as GetObject in VB. And UCOMIRunningObjectTable/System.Runtime.InteropServices.ComTypes.IRunningObjectTable is the .Net wrapper for the ROT. You probably want to read Don Box's Essential COM and Kraig Brockschmidt's Inside OLE, 2nd editon for more details on how to work with ROT or COM in general.

    I wonder why you choose the ROT for inter-process communication, though, if you control the code for both the COM server and the client. My first choice would be WCF with NetNamedPipeBinding, or if you stuck with .Net 2.0, .Net Remoting.



    Visual C++ MVP



    Tuesday, January 20, 2015 7:00 PM

All replies

  • Marshal.GetActiveObject is the .Net wrapper of the GetActiveObject API which is exposed as GetObject in VB. And UCOMIRunningObjectTable/System.Runtime.InteropServices.ComTypes.IRunningObjectTable is the .Net wrapper for the ROT. You probably want to read Don Box's Essential COM and Kraig Brockschmidt's Inside OLE, 2nd editon for more details on how to work with ROT or COM in general.

    I wonder why you choose the ROT for inter-process communication, though, if you control the code for both the COM server and the client. My first choice would be WCF with NetNamedPipeBinding, or if you stuck with .Net 2.0, .Net Remoting.



    Visual C++ MVP



    Tuesday, January 20, 2015 7:00 PM
  • If it's a new application, I'll most likely use WCF for sure.  I'm trying to get a grasp on this due to some interfacing with a third-party application API that already uses this approach and like I said, I have limited knowledge on it to begin with.  I may look up the books as well, always good to have a foundational understanding, but would like a nice "get-up-to-speed-quick" blog or example if anyone knows of any for now. 

    Jason

    Tuesday, January 20, 2015 7:25 PM