all groups > dotnet clr > december 2003 >
You're in the

dotnet clr

group:

problem in making ActiveX calls from C#


problem in making ActiveX calls from C# anushuks NO[at]SPAM yahoo.com
12/31/2003 11:18:54 PM
dotnet clr: Hi all,

I have to make a call to an ActiveX component from C#. The ActiveX
call expects a VARIANT *. I keep getting an exception (COMException)
"type Mismatch" on making the call.

The call I made was

{
Object Obj = new Object();
ActiveXCall(ref Obj); // Gives "Type mismatch" at run time ,
// ActiveXCall expects "VARIANT *"

}


If I call the same ActiveX component from VB, I can make successful
calls to the ActiveX by passing Variant as parameter.

I am new to C#, please let me know if I am doing something wrong..


regards
Re: problem in making ActiveX calls from C# Ben Rush
1/5/2004 3:48:56 PM
Anurag,

Variant is Object in the framework - so you're pretty close. Your problem
appears to be the fact that your ActiveX component is expecting a Variant
pointer (at least that I can see). Unfortunately I'm not sure what that
would need to be as I've never done marshaling of a pointer to a Variant
data type before. Probably somebody else out there is more equipped to
answer this question than I.

Ben

[quoted text, click to view]

Re: problem in making ActiveX calls from C# Hiroaki SHIBUKI
1/12/2004 1:26:54 AM
Hi,

[quoted text, click to view]

Please show me its .odl or .idl.

[quoted text, click to view]

Is legacy VB or VB.NET?

--
Hiroaki SHIBUKI


[quoted text, click to view]
AddThis Social Bookmark Button