Hey all.
I have this COM server and a method on it takes a variant type, how can i declare a pass a variant in c#?
Printable View
Hey all.
I have this COM server and a method on it takes a variant type, how can i declare a pass a variant in c#?
What does tlbimp.exe have to say about the dll ? Add the dll as a reference to your project and see what the wrapper class does.
Darwen.
A COM VARIANT type (as well as IUnknown* and IDispatch*) is marshalled as a System.Object. Say you have a function like this
Then you can do it like this:Code:HRESULT Open(
[in] VARIANT* FileName,
[in] VARIANT options);
The COM attribute/C# modifier table is :Code:object fileName = @"c:\test.txt";
object options = 0; // some flags
Open(ref fileName, options);
See this link http://msdn.microsoft.com/library/de...forobjects.asp for more.Code:[in] - > <no_modifier>
[out] - > out
[in, out] - > ref
[out, retval] - > <return_value>
cheers cilu