Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced(to me, least) COM Interop, remoting question...

Status
Not open for further replies.

bppj

Programmer
Jun 6, 2002
24
US
Writing several programs in C# that require using a COM server. I can interop no problem. The challenge lies in the fact that each time I need to use the COM server, I end up having to log into a "session". That process can take 30 seconds or more. This wait is unacceptable for our situation.

The initial solution I have come up with is to create a C# "server" application that logs in on startup and makes itself available via TCP/Binary remoting for cross process calls. It logs into a session and waits for calls to deliver a MarshalByReference instance of my COM "session". I have already fought with and resolved my server-side instance lifetime and deserialization issues. In fact, everything works great, for the most part.

When I need to use the marshalled "Session" for methods that return COM objects or primatives (i.e. int, string) and contain primatives as parameters, everything works great. However, when I need to access a method that takes a locally created COM object instance as a parameter, I receive the following error:

Code:
The argument type System.MarshalByRefObject cannot be converted into parameter type <my com type here>

I have the feeling I need to do something to allow passing a COM interop instance by value, but I don't know what.

Anybody have any ideas? Thanks in advance!

B.J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top