[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

COM DLL works fine in C# but not when using Remoting

SARA

8/5/2004 10:07:00 PM

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

10 Answers

Sunny

8/6/2004 5:04:00 AM

0

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

SARA

8/6/2004 1:25:00 PM

0

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
>

Sam Santiago

8/6/2004 4:01:00 PM

0

Sounds like a security problem. The user your request ends up running as
does not have rights to instantiate a COM object. Check out this link:

Implementing Impersonation in ASP.NET
http://support.microsoft.com/default.aspx?scid=kb;EN...

And this posting to the newsgroup from last year:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"SARA" <SARA@discussions.microsoft.com> wrote in message
news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> 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(Met
hodBase
> mb, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext,
> Object[]& outArgs)
> at
>
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
ge 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
> >


Sam Santiago

8/6/2004 10:41:00 PM

0

I thought you were hosting your remote server in IIS for some reason. You
might want to post some stub code here to see then. Most of the references
to that error number seem to be security related though in MS KB or Google
newsgroup search. As a test you might want to set a given Identity for you
COM+ application to run under as a test so that you can rule out the passing
of security credentials as a cause. To do this, in Component Services, look
at your COM+ application properties and set the Identity to a specific user.
Security might not be involved at all, but it's worth ruling out.

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"SARA" <SARA@discussions.microsoft.com> wrote in message
news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> I am not using ASP.NET or XML Web Services at this time. I have a regular
C#
> client trying to call the function on the remote object. My client, MBR
> Class and server are on the same machine in the same folder. Everything
> works fine when I call other functions on my ISession object that return
> strings.
>
> "Sam Santiago" wrote:
>
> > Sounds like a security problem. The user your request ends up running
as
> > does not have rights to instantiate a COM object. Check out this link:
> >
> > Implementing Impersonation in ASP.NET
> > http://support.microsoft.com/default.aspx?scid=kb;EN...
> >
> > And this posting to the newsgroup from last year:
> >
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> >
> > Thanks,
> >
> > Sam
> >
> > --
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> > http://www.SoftiTe...
> > _______________________________
> > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > 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(Met
> > hodBase
> > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > fExecuteInContext,
> > > Object[]& outArgs)
> > > at
> > >
> >
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > ge 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
> > > >
> >
> >
> >


Sam Santiago

8/10/2004 6:08:00 PM

0

So TestLib is a COM+ DLL? Is this deployed in a COM+ application within
Component Services and on the same machine as the remoting server?

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"SARA" <SARA@discussions.microsoft.com> wrote in message
news:7DC63084-A37A-4040-9874-DE1B42D029F7@microsoft.com...
> The host I am connecting to from the MBR is different from the machine
that
> is hosting the MBR.
>
> public class TestRemote : MarshalByRefObject
> {
> private TestClientLib.Session mySession;
> private TestLib.SessionResolver mySessionResolver;
> private Hashtable agentTable = new Hashtable();
>
> public TestRemote()
> {
> try
> {
> mySessionResolver = new TestLib.SessionResolver();
> mySession = (TestLib.Session) mySessionResolver.GetSession("");
> }
> catch(Exception e)
> {
> System.Console.WriteLine(e);
> }
> }
> public void connect()
> {
> //
> //Build args list for to connect
> //
> TestLib.Argument myArgs = new TestLib.ArgumentClass();
>
> object host = "HOST"; object IP= "x.x.x.x";
> object port = "PORT";
> object portNum = "42000";
>
> myArgs.AddItem(ref host, ref IP);
> myArgs.AddItem(ref port, ref portNum);
>
> //
> // Connect
> //
> mySession.Connect(myArgs);
>
> }
> }
>
> "Sam Santiago" wrote:
>
> > I thought you were hosting your remote server in IIS for some reason.
You
> > might want to post some stub code here to see then. Most of the
references
> > to that error number seem to be security related though in MS KB or
Google
> > newsgroup search. As a test you might want to set a given Identity for
you
> > COM+ application to run under as a test so that you can rule out the
passing
> > of security credentials as a cause. To do this, in Component Services,
look
> > at your COM+ application properties and set the Identity to a specific
user.
> > Security might not be involved at all, but it's worth ruling out.
> >
> > Thanks,
> >
> > Sam
> >
> > --
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> > http://www.SoftiTe...
> > _______________________________
> > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> > > I am not using ASP.NET or XML Web Services at this time. I have a
regular
> > C#
> > > client trying to call the function on the remote object. My client,
MBR
> > > Class and server are on the same machine in the same folder.
Everything
> > > works fine when I call other functions on my ISession object that
return
> > > strings.
> > >
> > > "Sam Santiago" wrote:
> > >
> > > > Sounds like a security problem. The user your request ends up
running
> > as
> > > > does not have rights to instantiate a COM object. Check out this
link:
> > > >
> > > > Implementing Impersonation in ASP.NET
> > > > http://support.microsoft.com/default.aspx?scid=kb;EN...
> > > >
> > > > And this posting to the newsgroup from last year:
> > > >
> >
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> > > >
> > > > Thanks,
> > > >
> > > > Sam
> > > >
> > > > --
> > > > _______________________________
> > > > Sam Santiago
> > > > ssantiago@n0spam-SoftiTechture.com
> > > > http://www.SoftiTe...
> > > > _______________________________
> > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > > > 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(Met
> > > > hodBase
> > > > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > > > fExecuteInContext,
> > > > > Object[]& outArgs)
> > > > > at
> > > > >
> > > >
> >
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > > > ge 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
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >


SARA

8/10/2004 8:03:00 PM

0

Thank you very much for helping me with this.

TestLib is an RCW for a COM DLL. I have used .NET Wizard to TRUST the RCW.
It stilll does not work. What am I missing? I have also changed the .NET
Security for Local Intranet to "Full Trust". The COM DLL is also in the same
folder and is registered correctly.

"Sam Santiago" wrote:

> So TestLib is a COM+ DLL? Is this deployed in a COM+ application within
> Component Services and on the same machine as the remoting server?
>
> --
> _______________________________
> Sam Santiago
> ssantiago@n0spam-SoftiTechture.com
> http://www.SoftiTe...
> _______________________________
> "SARA" <SARA@discussions.microsoft.com> wrote in message
> news:7DC63084-A37A-4040-9874-DE1B42D029F7@microsoft.com...
> > The host I am connecting to from the MBR is different from the machine
> that
> > is hosting the MBR.
> >
> > public class TestRemote : MarshalByRefObject
> > {
> > private TestClientLib.Session mySession;
> > private TestLib.SessionResolver mySessionResolver;
> > private Hashtable agentTable = new Hashtable();
> >
> > public TestRemote()
> > {
> > try
> > {
> > mySessionResolver = new TestLib.SessionResolver();
> > mySession = (TestLib.Session) mySessionResolver.GetSession("");
> > }
> > catch(Exception e)
> > {
> > System.Console.WriteLine(e);
> > }
> > }
> > public void connect()
> > {
> > //
> > //Build args list for to connect
> > //
> > TestLib.Argument myArgs = new TestLib.ArgumentClass();
> >
> > object host = "HOST"; object IP= "x.x.x.x";
> > object port = "PORT";
> > object portNum = "42000";
> >
> > myArgs.AddItem(ref host, ref IP);
> > myArgs.AddItem(ref port, ref portNum);
> >
> > //
> > // Connect
> > //
> > mySession.Connect(myArgs);
> >
> > }
> > }
> >
> > "Sam Santiago" wrote:
> >
> > > I thought you were hosting your remote server in IIS for some reason.
> You
> > > might want to post some stub code here to see then. Most of the
> references
> > > to that error number seem to be security related though in MS KB or
> Google
> > > newsgroup search. As a test you might want to set a given Identity for
> you
> > > COM+ application to run under as a test so that you can rule out the
> passing
> > > of security credentials as a cause. To do this, in Component Services,
> look
> > > at your COM+ application properties and set the Identity to a specific
> user.
> > > Security might not be involved at all, but it's worth ruling out.
> > >
> > > Thanks,
> > >
> > > Sam
> > >
> > > --
> > > _______________________________
> > > Sam Santiago
> > > ssantiago@n0spam-SoftiTechture.com
> > > http://www.SoftiTe...
> > > _______________________________
> > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> > > > I am not using ASP.NET or XML Web Services at this time. I have a
> regular
> > > C#
> > > > client trying to call the function on the remote object. My client,
> MBR
> > > > Class and server are on the same machine in the same folder.
> Everything
> > > > works fine when I call other functions on my ISession object that
> return
> > > > strings.
> > > >
> > > > "Sam Santiago" wrote:
> > > >
> > > > > Sounds like a security problem. The user your request ends up
> running
> > > as
> > > > > does not have rights to instantiate a COM object. Check out this
> link:
> > > > >
> > > > > Implementing Impersonation in ASP.NET
> > > > > http://support.microsoft.com/default.aspx?scid=kb;EN...
> > > > >
> > > > > And this posting to the newsgroup from last year:
> > > > >
> > >
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Sam
> > > > >
> > > > > --
> > > > > _______________________________
> > > > > Sam Santiago
> > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > http://www.SoftiTe...
> > > > > _______________________________
> > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > > > > 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(Met
> > > > > hodBase
> > > > > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > > > > fExecuteInContext,
> > > > > > Object[]& outArgs)
> > > > > > at
> > > > > >
> > > > >
> > >
> System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > > > > ge 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
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>

SARA

8/11/2004 12:07:00 AM

0

I do not see my COM DLL in DCOM Config.

"Sam Santiago" wrote:

> Can you try setting security on the COM DLL as a test. Using Component Services under Admin tools, use the DCOM Config folder to find your COM DLL and edit the Launch Permissions and Access Permissions on your COM DLL. Add the Everyone group to each list. Also, in the Identity tab you might need to set this COM DLL to run as a user with specific rights - try an admin as a test. I have attached a picture of this dialog.
>
>
>
>
> Thanks,
>
> Sam
>
> --
> _______________________________
> Sam Santiago
> ssantiago@n0spam-SoftiTechture.com
> http://www.SoftiTe...
> _______________________________
> "SARA" <SARA@discussions.microsoft.com> wrote in message news:E3EA1D86-FE71-41EB-B0F8-58C293110F21@microsoft.com...
> > Thank you very much for helping me with this.
> >
> > TestLib is an RCW for a COM DLL. I have used .NET Wizard to TRUST the RCW.
> > It stilll does not work. What am I missing? I have also changed the ..NET
> > Security for Local Intranet to "Full Trust". The COM DLL is also in the same
> > folder and is registered correctly.
> >
> > "Sam Santiago" wrote:
> >
> > > So TestLib is a COM+ DLL? Is this deployed in a COM+ application within
> > > Component Services and on the same machine as the remoting server?
> > >
> > > --
> > > _______________________________
> > > Sam Santiago
> > > ssantiago@n0spam-SoftiTechture.com
> > > http://www.SoftiTe...
> > > _______________________________
> > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > news:7DC63084-A37A-4040-9874-DE1B42D029F7@microsoft.com...
> > > > The host I am connecting to from the MBR is different from the machine
> > > that
> > > > is hosting the MBR.
> > > >
> > > > public class TestRemote : MarshalByRefObject
> > > > {
> > > > private TestClientLib.Session mySession;
> > > > private TestLib.SessionResolver mySessionResolver;
> > > > private Hashtable agentTable = new Hashtable();
> > > >
> > > > public TestRemote()
> > > > {
> > > > try
> > > > {
> > > > mySessionResolver = new TestLib.SessionResolver();
> > > > mySession = (TestLib.Session) mySessionResolver.GetSession("");
> > > > }
> > > > catch(Exception e)
> > > > {
> > > > System.Console.WriteLine(e);
> > > > }
> > > > }
> > > > public void connect()
> > > > {
> > > > //
> > > > //Build args list for to connect
> > > > //
> > > > TestLib.Argument myArgs = new TestLib.ArgumentClass();
> > > >
> > > > object host = "HOST"; object IP= "x.x.x.x";
> > > > object port = "PORT";
> > > > object portNum = "42000";
> > > >
> > > > myArgs.AddItem(ref host, ref IP);
> > > > myArgs.AddItem(ref port, ref portNum);
> > > >
> > > > //
> > > > // Connect
> > > > //
> > > > mySession.Connect(myArgs);
> > > >
> > > > }
> > > > }
> > > >
> > > > "Sam Santiago" wrote:
> > > >
> > > > > I thought you were hosting your remote server in IIS for some reason.
> > > You
> > > > > might want to post some stub code here to see then. Most of the
> > > references
> > > > > to that error number seem to be security related though in MS KB or
> > > Google
> > > > > newsgroup search. As a test you might want to set a given Identity for
> > > you
> > > > > COM+ application to run under as a test so that you can rule out the
> > > passing
> > > > > of security credentials as a cause. To do this, in Component Services,
> > > look
> > > > > at your COM+ application properties and set the Identity to a specific
> > > user.
> > > > > Security might not be involved at all, but it's worth ruling out.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Sam
> > > > >
> > > > > --
> > > > > _______________________________
> > > > > Sam Santiago
> > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > http://www.SoftiTe...
> > > > > _______________________________
> > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> > > > > > I am not using ASP.NET or XML Web Services at this time. I have a
> > > regular
> > > > > C#
> > > > > > client trying to call the function on the remote object. My client,
> > > MBR
> > > > > > Class and server are on the same machine in the same folder.
> > > Everything
> > > > > > works fine when I call other functions on my ISession object that
> > > return
> > > > > > strings.
> > > > > >
> > > > > > "Sam Santiago" wrote:
> > > > > >
> > > > > > > Sounds like a security problem. The user your request ends up
> > > running
> > > > > as
> > > > > > > does not have rights to instantiate a COM object. Check out this
> > > link:
> > > > > > >
> > > > > > > Implementing Impersonation in ASP.NET
> > > > > > > http://support.microsoft.com/default.aspx?scid=kb;EN...
> > > > > > >
> > > > > > > And this posting to the newsgroup from last year:
> > > > > > >
> > > > >
> > > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > Sam
> > > > > > >
> > > > > > > --
> > > > > > > _______________________________
> > > > > > > Sam Santiago
> > > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > > http://www.SoftiTe...
> > > > > > > _______________________________
> > > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > > > > > > 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(Met
> > > > > > > hodBase
> > > > > > > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > > > > > > fExecuteInContext,
> > > > > > > > Object[]& outArgs)
> > > > > > > > at
> > > > > > > >
> > > > > > >
> > > > >
> > > System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > > > > > > ge 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
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >

Sam Santiago

8/11/2004 12:40:00 AM

0

You might not see the name, but if you scroll down you can see some GUIDS.
One will be your DLL. You can edit the machine options instead. Right
click on My Computer in Component Services and choose properties. Select
the Default COM Security tab and edit the default permissions there. Add
Everyone to both rights.

Thanks,

Sam
--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"SARA" <SARA@discussions.microsoft.com> wrote in message
news:8D508261-35E0-470C-90DE-18F8F329A7A4@microsoft.com...
> I do not see my COM DLL in DCOM Config.
>
> "Sam Santiago" wrote:
>
> > Can you try setting security on the COM DLL as a test. Using Component
Services under Admin tools, use the DCOM Config folder to find your COM DLL
and edit the Launch Permissions and Access Permissions on your COM DLL.
Add the Everyone group to each list. Also, in the Identity tab you might
need to set this COM DLL to run as a user with specific rights - try an
admin as a test. I have attached a picture of this dialog.
> >
> >
> >
> >
> > Thanks,
> >
> > Sam
> >
> > --
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> > http://www.SoftiTe...
> > _______________________________
> > "SARA" <SARA@discussions.microsoft.com> wrote in message
news:E3EA1D86-FE71-41EB-B0F8-58C293110F21@microsoft.com...
> > > Thank you very much for helping me with this.
> > >
> > > TestLib is an RCW for a COM DLL. I have used .NET Wizard to TRUST the
RCW.
> > > It stilll does not work. What am I missing? I have also changed the
...NET
> > > Security for Local Intranet to "Full Trust". The COM DLL is also in
the same
> > > folder and is registered correctly.
> > >
> > > "Sam Santiago" wrote:
> > >
> > > > So TestLib is a COM+ DLL? Is this deployed in a COM+ application
within
> > > > Component Services and on the same machine as the remoting server?
> > > >
> > > > --
> > > > _______________________________
> > > > Sam Santiago
> > > > ssantiago@n0spam-SoftiTechture.com
> > > > http://www.SoftiTe...
> > > > _______________________________
> > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > news:7DC63084-A37A-4040-9874-DE1B42D029F7@microsoft.com...
> > > > > The host I am connecting to from the MBR is different from the
machine
> > > > that
> > > > > is hosting the MBR.
> > > > >
> > > > > public class TestRemote : MarshalByRefObject
> > > > > {
> > > > > private TestClientLib.Session mySession;
> > > > > private TestLib.SessionResolver mySessionResolver;
> > > > > private Hashtable agentTable = new Hashtable();
> > > > >
> > > > > public TestRemote()
> > > > > {
> > > > > try
> > > > > {
> > > > > mySessionResolver = new TestLib.SessionResolver();
> > > > > mySession = (TestLib.Session) mySessionResolver.GetSession("");
> > > > > }
> > > > > catch(Exception e)
> > > > > {
> > > > > System.Console.WriteLine(e);
> > > > > }
> > > > > }
> > > > > public void connect()
> > > > > {
> > > > > //
> > > > > //Build args list for to connect
> > > > > //
> > > > > TestLib.Argument myArgs = new TestLib.ArgumentClass();
> > > > >
> > > > > object host = "HOST"; object IP= "x.x.x.x";
> > > > > object port = "PORT";
> > > > > object portNum = "42000";
> > > > >
> > > > > myArgs.AddItem(ref host, ref IP);
> > > > > myArgs.AddItem(ref port, ref portNum);
> > > > >
> > > > > //
> > > > > // Connect
> > > > > //
> > > > > mySession.Connect(myArgs);
> > > > >
> > > > > }
> > > > > }
> > > > >
> > > > > "Sam Santiago" wrote:
> > > > >
> > > > > > I thought you were hosting your remote server in IIS for some
reason.
> > > > You
> > > > > > might want to post some stub code here to see then. Most of the
> > > > references
> > > > > > to that error number seem to be security related though in MS KB
or
> > > > Google
> > > > > > newsgroup search. As a test you might want to set a given
Identity for
> > > > you
> > > > > > COM+ application to run under as a test so that you can rule out
the
> > > > passing
> > > > > > of security credentials as a cause. To do this, in Component
Services,
> > > > look
> > > > > > at your COM+ application properties and set the Identity to a
specific
> > > > user.
> > > > > > Security might not be involved at all, but it's worth ruling
out.
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Sam
> > > > > >
> > > > > > --
> > > > > > _______________________________
> > > > > > Sam Santiago
> > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > http://www.SoftiTe...
> > > > > > _______________________________
> > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> > > > > > > I am not using ASP.NET or XML Web Services at this time. I
have a
> > > > regular
> > > > > > C#
> > > > > > > client trying to call the function on the remote object. My
client,
> > > > MBR
> > > > > > > Class and server are on the same machine in the same folder.
> > > > Everything
> > > > > > > works fine when I call other functions on my ISession object
that
> > > > return
> > > > > > > strings.
> > > > > > >
> > > > > > > "Sam Santiago" wrote:
> > > > > > >
> > > > > > > > Sounds like a security problem. The user your request ends
up
> > > > running
> > > > > > as
> > > > > > > > does not have rights to instantiate a COM object. Check out
this
> > > > link:
> > > > > > > >
> > > > > > > > Implementing Impersonation in ASP.NET
> > > > > > > >
http://support.microsoft.com/default.aspx?scid=kb;EN...
> > > > > > > >
> > > > > > > > And this posting to the newsgroup from last year:
> > > > > > > >
> > > > > >
> > > >
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Sam
> > > > > > > >
> > > > > > > > --
> > > > > > > > _______________________________
> > > > > > > > Sam Santiago
> > > > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > > > http://www.SoftiTe...
> > > > > > > > _______________________________
> > > > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > > > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > > > > > > > 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(Met
> > > > > > > > hodBase
> > > > > > > > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > > > > > > > fExecuteInContext,
> > > > > > > > > Object[]& outArgs)
> > > > > > > > > at
> > > > > > > > >
> > > > > > > >
> > > > > >
> > > >
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > > > > > > > ge 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
> > > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >


SARA

8/11/2004 12:55:00 AM

0

Actually, I am on Win2000 so I used dcomcnfg.exe instead of Component
Services. Also, there are only 2 GUIDs in my list on DCOM Config and neither
of them is my DLL (I checked in regedit).

I already tried changing the default permissions but I still get the same
exception.

I do not know if I said this in my earlier posts but the Connect() function
opens a socket connection to another machine.

"Sam Santiago" wrote:

> You might not see the name, but if you scroll down you can see some GUIDS.
> One will be your DLL. You can edit the machine options instead. Right
> click on My Computer in Component Services and choose properties. Select
> the Default COM Security tab and edit the default permissions there. Add
> Everyone to both rights.
>
> Thanks,
>
> Sam
> --
> _______________________________
> Sam Santiago
> ssantiago@n0spam-SoftiTechture.com
> http://www.SoftiTe...
> _______________________________
> "SARA" <SARA@discussions.microsoft.com> wrote in message
> news:8D508261-35E0-470C-90DE-18F8F329A7A4@microsoft.com...
> > I do not see my COM DLL in DCOM Config.
> >
> > "Sam Santiago" wrote:
> >
> > > Can you try setting security on the COM DLL as a test. Using Component
> Services under Admin tools, use the DCOM Config folder to find your COM DLL
> and edit the Launch Permissions and Access Permissions on your COM DLL.
> Add the Everyone group to each list. Also, in the Identity tab you might
> need to set this COM DLL to run as a user with specific rights - try an
> admin as a test. I have attached a picture of this dialog.
> > >
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Sam
> > >
> > > --
> > > _______________________________
> > > Sam Santiago
> > > ssantiago@n0spam-SoftiTechture.com
> > > http://www.SoftiTe...
> > > _______________________________
> > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> news:E3EA1D86-FE71-41EB-B0F8-58C293110F21@microsoft.com...
> > > > Thank you very much for helping me with this.
> > > >
> > > > TestLib is an RCW for a COM DLL. I have used .NET Wizard to TRUST the
> RCW.
> > > > It stilll does not work. What am I missing? I have also changed the
> ...NET
> > > > Security for Local Intranet to "Full Trust". The COM DLL is also in
> the same
> > > > folder and is registered correctly.
> > > >
> > > > "Sam Santiago" wrote:
> > > >
> > > > > So TestLib is a COM+ DLL? Is this deployed in a COM+ application
> within
> > > > > Component Services and on the same machine as the remoting server?
> > > > >
> > > > > --
> > > > > _______________________________
> > > > > Sam Santiago
> > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > http://www.SoftiTe...
> > > > > _______________________________
> > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > news:7DC63084-A37A-4040-9874-DE1B42D029F7@microsoft.com...
> > > > > > The host I am connecting to from the MBR is different from the
> machine
> > > > > that
> > > > > > is hosting the MBR.
> > > > > >
> > > > > > public class TestRemote : MarshalByRefObject
> > > > > > {
> > > > > > private TestClientLib.Session mySession;
> > > > > > private TestLib.SessionResolver mySessionResolver;
> > > > > > private Hashtable agentTable = new Hashtable();
> > > > > >
> > > > > > public TestRemote()
> > > > > > {
> > > > > > try
> > > > > > {
> > > > > > mySessionResolver = new TestLib.SessionResolver();
> > > > > > mySession = (TestLib.Session) mySessionResolver.GetSession("");
> > > > > > }
> > > > > > catch(Exception e)
> > > > > > {
> > > > > > System.Console.WriteLine(e);
> > > > > > }
> > > > > > }
> > > > > > public void connect()
> > > > > > {
> > > > > > //
> > > > > > //Build args list for to connect
> > > > > > //
> > > > > > TestLib.Argument myArgs = new TestLib.ArgumentClass();
> > > > > >
> > > > > > object host = "HOST"; object IP= "x.x.x.x";
> > > > > > object port = "PORT";
> > > > > > object portNum = "42000";
> > > > > >
> > > > > > myArgs.AddItem(ref host, ref IP);
> > > > > > myArgs.AddItem(ref port, ref portNum);
> > > > > >
> > > > > > //
> > > > > > // Connect
> > > > > > //
> > > > > > mySession.Connect(myArgs);
> > > > > >
> > > > > > }
> > > > > > }
> > > > > >
> > > > > > "Sam Santiago" wrote:
> > > > > >
> > > > > > > I thought you were hosting your remote server in IIS for some
> reason.
> > > > > You
> > > > > > > might want to post some stub code here to see then. Most of the
> > > > > references
> > > > > > > to that error number seem to be security related though in MS KB
> or
> > > > > Google
> > > > > > > newsgroup search. As a test you might want to set a given
> Identity for
> > > > > you
> > > > > > > COM+ application to run under as a test so that you can rule out
> the
> > > > > passing
> > > > > > > of security credentials as a cause. To do this, in Component
> Services,
> > > > > look
> > > > > > > at your COM+ application properties and set the Identity to a
> specific
> > > > > user.
> > > > > > > Security might not be involved at all, but it's worth ruling
> out.
> > > > > > >
> > > > > > > Thanks,
> > > > > > >
> > > > > > > Sam
> > > > > > >
> > > > > > > --
> > > > > > > _______________________________
> > > > > > > Sam Santiago
> > > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > > http://www.SoftiTe...
> > > > > > > _______________________________
> > > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > > news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> > > > > > > > I am not using ASP.NET or XML Web Services at this time. I
> have a
> > > > > regular
> > > > > > > C#
> > > > > > > > client trying to call the function on the remote object. My
> client,
> > > > > MBR
> > > > > > > > Class and server are on the same machine in the same folder.
> > > > > Everything
> > > > > > > > works fine when I call other functions on my ISession object
> that
> > > > > return
> > > > > > > > strings.
> > > > > > > >
> > > > > > > > "Sam Santiago" wrote:
> > > > > > > >
> > > > > > > > > Sounds like a security problem. The user your request ends
> up
> > > > > running
> > > > > > > as
> > > > > > > > > does not have rights to instantiate a COM object. Check out
> this
> > > > > link:
> > > > > > > > >
> > > > > > > > > Implementing Impersonation in ASP.NET
> > > > > > > > >
> http://support.microsoft.com/default.aspx?scid=kb;EN...
> > > > > > > > >
> > > > > > > > > And this posting to the newsgroup from last year:
> > > > > > > > >
> > > > > > >
> > > > >
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> > > > > > > > >
> > > > > > > > > Thanks,
> > > > > > > > >
> > > > > > > > > Sam
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > _______________________________
> > > > > > > > > Sam Santiago
> > > > > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > > > > http://www.SoftiTe...
> > > > > > > > > _______________________________
> > > > > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > > > > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > > > > > > > > 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(Met
> > > > > > > > > hodBase
> > > > > > > > > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > > > > > > > > fExecuteInContext,
> > > > > > > > > > Object[]& outArgs)
> > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > >
> System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > > > > > > > > ge 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
> > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
>
>
>

Sam Santiago

8/11/2004 4:18:00 AM

0

How about simply commented out the code inside the COM+ Connect function so
you can determine if the call makes it to the COM+ method or somewhere
before the method is even invoked.

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"SARA" <SARA@discussions.microsoft.com> wrote in message
news:AF148CC5-C2AE-4330-B4DC-F35F93F0B5AA@microsoft.com...
> Actually, I am on Win2000 so I used dcomcnfg.exe instead of Component
> Services. Also, there are only 2 GUIDs in my list on DCOM Config and
neither
> of them is my DLL (I checked in regedit).
>
> I already tried changing the default permissions but I still get the same
> exception.
>
> I do not know if I said this in my earlier posts but the Connect()
function
> opens a socket connection to another machine.
>
> "Sam Santiago" wrote:
>
> > You might not see the name, but if you scroll down you can see some
GUIDS.
> > One will be your DLL. You can edit the machine options instead. Right
> > click on My Computer in Component Services and choose properties.
Select
> > the Default COM Security tab and edit the default permissions there.
Add
> > Everyone to both rights.
> >
> > Thanks,
> >
> > Sam
> > --
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> > http://www.SoftiTe...
> > _______________________________
> > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > news:8D508261-35E0-470C-90DE-18F8F329A7A4@microsoft.com...
> > > I do not see my COM DLL in DCOM Config.
> > >
> > > "Sam Santiago" wrote:
> > >
> > > > Can you try setting security on the COM DLL as a test. Using
Component
> > Services under Admin tools, use the DCOM Config folder to find your COM
DLL
> > and edit the Launch Permissions and Access Permissions on your COM DLL.
> > Add the Everyone group to each list. Also, in the Identity tab you
might
> > need to set this COM DLL to run as a user with specific rights - try an
> > admin as a test. I have attached a picture of this dialog.
> > > >
> > > >
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Sam
> > > >
> > > > --
> > > > _______________________________
> > > > Sam Santiago
> > > > ssantiago@n0spam-SoftiTechture.com
> > > > http://www.SoftiTe...
> > > > _______________________________
> > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > news:E3EA1D86-FE71-41EB-B0F8-58C293110F21@microsoft.com...
> > > > > Thank you very much for helping me with this.
> > > > >
> > > > > TestLib is an RCW for a COM DLL. I have used .NET Wizard to TRUST
the
> > RCW.
> > > > > It stilll does not work. What am I missing? I have also changed
the
> > ...NET
> > > > > Security for Local Intranet to "Full Trust". The COM DLL is also
in
> > the same
> > > > > folder and is registered correctly.
> > > > >
> > > > > "Sam Santiago" wrote:
> > > > >
> > > > > > So TestLib is a COM+ DLL? Is this deployed in a COM+
application
> > within
> > > > > > Component Services and on the same machine as the remoting
server?
> > > > > >
> > > > > > --
> > > > > > _______________________________
> > > > > > Sam Santiago
> > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > http://www.SoftiTe...
> > > > > > _______________________________
> > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > news:7DC63084-A37A-4040-9874-DE1B42D029F7@microsoft.com...
> > > > > > > The host I am connecting to from the MBR is different from the
> > machine
> > > > > > that
> > > > > > > is hosting the MBR.
> > > > > > >
> > > > > > > public class TestRemote : MarshalByRefObject
> > > > > > > {
> > > > > > > private TestClientLib.Session mySession;
> > > > > > > private TestLib.SessionResolver mySessionResolver;
> > > > > > > private Hashtable agentTable = new Hashtable();
> > > > > > >
> > > > > > > public TestRemote()
> > > > > > > {
> > > > > > > try
> > > > > > > {
> > > > > > > mySessionResolver = new TestLib.SessionResolver();
> > > > > > > mySession = (TestLib.Session)
mySessionResolver.GetSession("");
> > > > > > > }
> > > > > > > catch(Exception e)
> > > > > > > {
> > > > > > > System.Console.WriteLine(e);
> > > > > > > }
> > > > > > > }
> > > > > > > public void connect()
> > > > > > > {
> > > > > > > //
> > > > > > > //Build args list for to connect
> > > > > > > //
> > > > > > > TestLib.Argument myArgs = new TestLib.ArgumentClass();
> > > > > > >
> > > > > > > object host = "HOST"; object IP= "x.x.x.x";
> > > > > > > object port = "PORT";
> > > > > > > object portNum = "42000";
> > > > > > >
> > > > > > > myArgs.AddItem(ref host, ref IP);
> > > > > > > myArgs.AddItem(ref port, ref portNum);
> > > > > > >
> > > > > > > //
> > > > > > > // Connect
> > > > > > > //
> > > > > > > mySession.Connect(myArgs);
> > > > > > >
> > > > > > > }
> > > > > > > }
> > > > > > >
> > > > > > > "Sam Santiago" wrote:
> > > > > > >
> > > > > > > > I thought you were hosting your remote server in IIS for
some
> > reason.
> > > > > > You
> > > > > > > > might want to post some stub code here to see then. Most of
the
> > > > > > references
> > > > > > > > to that error number seem to be security related though in
MS KB
> > or
> > > > > > Google
> > > > > > > > newsgroup search. As a test you might want to set a given
> > Identity for
> > > > > > you
> > > > > > > > COM+ application to run under as a test so that you can rule
out
> > the
> > > > > > passing
> > > > > > > > of security credentials as a cause. To do this, in
Component
> > Services,
> > > > > > look
> > > > > > > > at your COM+ application properties and set the Identity to
a
> > specific
> > > > > > user.
> > > > > > > > Security might not be involved at all, but it's worth ruling
> > out.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Sam
> > > > > > > >
> > > > > > > > --
> > > > > > > > _______________________________
> > > > > > > > Sam Santiago
> > > > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > > > http://www.SoftiTe...
> > > > > > > > _______________________________
> > > > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > > > news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> > > > > > > > > I am not using ASP.NET or XML Web Services at this time.
I
> > have a
> > > > > > regular
> > > > > > > > C#
> > > > > > > > > client trying to call the function on the remote object.
My
> > client,
> > > > > > MBR
> > > > > > > > > Class and server are on the same machine in the same
folder.
> > > > > > Everything
> > > > > > > > > works fine when I call other functions on my ISession
object
> > that
> > > > > > return
> > > > > > > > > strings.
> > > > > > > > >
> > > > > > > > > "Sam Santiago" wrote:
> > > > > > > > >
> > > > > > > > > > Sounds like a security problem. The user your request
ends
> > up
> > > > > > running
> > > > > > > > as
> > > > > > > > > > does not have rights to instantiate a COM object. Check
out
> > this
> > > > > > link:
> > > > > > > > > >
> > > > > > > > > > Implementing Impersonation in ASP.NET
> > > > > > > > > >
> > http://support.microsoft.com/default.aspx?scid=kb;EN...
> > > > > > > > > >
> > > > > > > > > > And this posting to the newsgroup from last year:
> > > > > > > > > >
> > > > > > > >
> > > > > >
> >
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP...
> > > > > > > > > >
> > > > > > > > > > Thanks,
> > > > > > > > > >
> > > > > > > > > > Sam
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > _______________________________
> > > > > > > > > > Sam Santiago
> > > > > > > > > > ssantiago@n0spam-SoftiTechture.com
> > > > > > > > > > http://www.SoftiTe...
> > > > > > > > > > _______________________________
> > > > > > > > > > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > > > > > > > > >
news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > > > > > > > > > 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(Met
> > > > > > > > > > hodBase
> > > > > > > > > > > mb, Object[] args, Object server, Int32 methodPtr,
Boolean
> > > > > > > > > > fExecuteInContext,
> > > > > > > > > > > Object[]& outArgs)
> > > > > > > > > > > at
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > >
> >
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > > > > > > > > > ge 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
> > > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> >
> >
> >