How to deploy Remoting object that using .NET COM using legacy COM?

goodmorningsky

Centurion
Joined
Aug 18, 2003
Messages
172
Hi, all...
Question sounds confusing..
Let me explain my question.
I'm using Remoting call..
Server Side..I created TimeClockComponent.NetworkUtils class.
that uses COM object written by VB.
This COM has method: DoPing.

My Client object call the Ping(string ipAddr) using Remote call.
So, actually the COM component is used in Server side!
I registered .NET Component and the COM in Serverside, but not in the Client side.

But, when I call Remote object, it thow exception like:
System.Runtime.InteropService.COMException (0x...): COM object with CLSID .... is either not valid or not registered.


My question is..
Why do I need resgister COM object in Remoting Client side?
Since COM is run in Server side.
and Client reference dll file to create Proxy only as I know..
Please reply with any knowledge considering this issue..
or any link about this issue..

Thank you...




using System;

namespace TimeClockComponent
{
/// <summary>
/// Summary description for NetworkUtils
/// NetworkUtilities reference comes from NetworkUtilities COM object
/// written by VB (ActiveX DLL)
/// First register the component using regsrv32 NetworkUtilities.dll
/// on client machine to run this application
/// </summary>
public class NetworkUtils
{
NetworkUtilities.NetUtilityClass netUtil;
public NetworkUtils()
{
//
// TODO: Add constructor logic here
//
netUtil = new NetworkUtilities.NetUtilityClass();

}
public bool Ping(string ipAddr)
{
bool result = netUtil.DoPing(ipAddr.Trim());
long re2 = netUtil.DoPingAsLong(ipAddr);

return result;
}
public bool test(string boolVal)
{
return netUtil.Test(boolVal);
}
}
}


// code snipet of the COM class method in VB
Public Function DoPing(ByVal ipAddr As String) As Boolean
Dim result As Long
Dim ECHO As ICMP_ECHO_REPLY
result = mdPing.Ping(ipAddr, "ECHO!!!", ECHO)
If result = 0 Then '-- success
DoPing = True
Else
DoPing = False
End If
End Function


//code snipet of Client app calling the Remote Component object

TimeClockComponent.NetworkUtils objNt = new TimeClockComponent.NetworkUtils();
MessageBox.Show(objNt.Ping("10.208.2.11").ToString());
 
Let me explian this way..

Since I think people doesn't understand my question let me explain this way.. please reply any comment..


Client app in Machine A want to call Ping object that locates in Machine B.
The Ping Object is in DLL file in B. This Ping Object Calls legacy COM object registered in Machine B.

I tried that Client in A calles Ping object remotely using Remoting api.. setting up channel with tcp.
DLL file containing Ping object is copied to Directory where Client application locates so that it can make proxy.
But, the legacy COM is not registered in B because the COM runs on MachineB.
But, the problem occurs when Client try to call Ping object.
it thow exception like:
System.Runtime.InteropService.COMException (0x...): COM object with CLSID .... is either not valid or not registered.

I don't want to register the COM in Client side because I want the COM runs on server side with servers previlege of my system architecture.

How can I remove this error?
There was no problem before the Ping object calls legacy COM object.

Please help with any comments...

Thank you..
 
Back
Top