Connecting to a legacy RPC server

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I have a C# application that I would like to modify to communicate
with a legacy RPC server to get some data. I have the IDL for that
server. Is there an IDL compiler that will give me C# code? What are
my options here?

Thanks,
Ben
 
Ben,

Is this a CORBA component or a distributed COM component (DCOM/COM+)?

If it is the latter, then you should be able to compile the IDL using
MIDL and then use the type library importer to create a managed
representation. Then, in code, you would call the static GetTypeFromProgID
or GetTypeFromCLSID to get the type that is associated with the
implementation of that interface. Pass that to the static CreateInstance
method on the Activator class, and then cast the return value to your
interface.
 
Ben said:
I have a C# application that I would like to modify to communicate
with a legacy RPC server to get some data. I have the IDL for that
server. Is there an IDL compiler that will give me C# code? What are
my options here?

Thanks,
Ben


NO there isn't, legacy RPC (and IDL) is meant to be used from C only. All
you can do is build a managed wrapper using C++/CLI and use this one as an
interface between managed code and your unmanaged RPC server.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top