I am developing a .NET client application that calls a classic COM server
located on a remote computer.
When I configure the location with the DCOMCNFG tool by checking the "Run
application on the following computer" check-box and giving the IP address,
it works fine. The new operator creates the remote object.
But I would like to do it programmatically within the .NET client
application.
How to tell the new operator the computer on which the COM object will be
instanciated ?
Thanks,
Michael
I do this in VB, using CreateObject("My.Component", "192.168.0.2"). It still
works, even in a WebApplication.
You can either use the IP address or the computer name.
Joachim
"Michael Cruanes" <michael...@nospam.omicron.at> wrote in message news:uy1RI6GmBHA.2432@tkmsftngp02...
"Type must be a type provided by the runtime, not a TypeDelegator, etc.
Parameter name: type"
here is the code that breaks this (managed c++):
System::Type * srvtype =
System::Type::GetTypeFromProgID("SomeRegisteredCOM.Class", false);
Object * srvobject = Activator::CreateInstance(srvtype);
any ideas?
thanks
Noah
"NETMaster" <spam.ne...@swissonline.ch> wrote in message
news:ugo#68ImBHA.1928@tkmsftngp07...
you may check thread-apartment or your COM control registration.
"Noah Kay-Oliphant" <arkb...@aol.com> wrote in message news:eeagsOJmBHA.1856@tkmsftngp04...
> I'm trying to use the code below to instantiate a COM component locally, but
> get this error:
> "Type must be a type provided by the runtime, not a TypeDelegator, etc. Parameter name: type"
then your string
"SomeRegisteredCOM.Class"
may be invalid.... (check COM registration)
or you may also try version-dependent like:
"SomeRegisteredCOM.Class.1"
(lookup in registry)
"Noah Kay-Oliphant" <arkb...@aol.com> wrote in message news:eeagsOJmBHA.1856@tkmsftngp04...