G
Guest
My question is how can I in C# call methods on a COM object without having an
interface or a RCW referenced. I have a COM component that I cannot import
into .NET, it throws a bunch of errors.
In VB.NET I was able to do the following:
Dim instance As Object
impromtuApplication = CreateObject("Impromptu.Application")
impromtuApplication.DoSomething("Paramters")
In C# I have somewhat the equivelant code:
string progId = "CognosImpromptu.Application";
Type comType = Type.GetTypeFromProgID(progId, true);
appInstance = Activator.CreateInstance(comType);
appInstance.DoSomething("Paramters"); // this line fails because it
says no method like this exists
So I know I have to cast this object to an Interface or COM object, is
there anyway to do this WITHOUT having the RCW or Interface. I don't want to
start writing VB.NET code to get this to work <shivers>
Thanks in advance
interface or a RCW referenced. I have a COM component that I cannot import
into .NET, it throws a bunch of errors.
In VB.NET I was able to do the following:
Dim instance As Object
impromtuApplication = CreateObject("Impromptu.Application")
impromtuApplication.DoSomething("Paramters")
In C# I have somewhat the equivelant code:
string progId = "CognosImpromptu.Application";
Type comType = Type.GetTypeFromProgID(progId, true);
appInstance = Activator.CreateInstance(comType);
appInstance.DoSomething("Paramters"); // this line fails because it
says no method like this exists
So I know I have to cast this object to an Interface or COM object, is
there anyway to do this WITHOUT having the RCW or Interface. I don't want to
start writing VB.NET code to get this to work <shivers>
Thanks in advance