Remote start of the COM server

I have a COM interface to run and use the program. This works fine on the local machine. Is it possible to run this program on another machine through the network without installing other software on it or making changes to the program?

+3
source share
2 answers

DCOM, although you need to configure security.

In C #, you can create an object remotely this way:

var obj = Activator.CreateInstance(Type.GetTypeFromProgID("Acme.Server", "remotepc", true));

So, to create an instance of the VB Regex library (so that it runs elsewhere)

dynamic re = Activator.CreateInstance(Type.GetTypeFromProgID("VBScript.RegExp", "remotepc", true));
re.IgnoreCase = true;   //Check that we can set properties
re.Pattern = "^A";
var chk = (re.Execute("Apple").Count > 0) ? "ok" : "failed";
Console.WriteLine(chk);
+2
source

, COM+. COM + , , , . COM- , , .

0

Source: https://habr.com/ru/post/1725066/


All Articles