Thanks for the quick response.
That is how I had it set up. I had the Session objectt declared as private.
I had a public function called connect(). Inside the connect() function I
was calling Session.Connect(Arg). Should the Arg object also be a private
member? Currently, I am creating a local object and passing it to the
Session.Connect(Arg) function.
Here's the exact exception I am getting:
Unhandled Exception: System.Runtime.InteropServices.COMException
(0x80010105): The server threw an exception.
Server stack trace:
at TestClientLib.ISession.Connect(Arg pConnectParam)
at TestNameSpace.TestRemote.connect() in
c:\MyWebServices\Test.NET\TestRemote.cs:line 68
at
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase
mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext,
Object[]& outArgs)
at
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at TestNameSpace.TestRemote.connect() in
c:\MyWebServices\Test.NET\TestRemote.cs:line 48
at TestNameSpace.RemoteClient.Main(String[] args) in
c:\MyWebServices\Test.NET\RemoteClient.cs:line 22
"Sunny" wrote:
> In article <F5C59F91-4C09-49A8-8FDF-7A64CA6FABE4@microsoft.com>,
> SARA@discussions.microsoft.com says...
> > Greetings All:
> >
> > I have a COM DLL that works perfectly fine in a C# program. However, if I
> > move the same code to a class that inherits from MarshalRefObj I get an
> > exception and I can not call the same function that I call correctly if I do
> > not use Remoting. The function in question is called Connect(Arg) in a class
> > called Session. I can call other functions in the Session class and teh Arg
> > class that return string args. However, the Connect(Arg) function fails and
> > throws System.Runtime.InteropServices.COMException.
> >
> > I am new to the .NET technology and I have tried searching the newsgroups
> > for this but have not found anything.
> >
> > I was curious to know what I am doing wrong.
> >
> > SARA
> >
> >
>
> Hi Sara,
>
> create the COM object as private in your MBR class. Then expose to the
> clients a wrapper methods, which in turn will call the COM object's
> methods.
>
> Sunny
>