I'm writing a program that uses a COM object. If I were
writing this code in VB6, the signature of the method of
the COM object I need to use would be: saveMemo
(Collection) The method takes a collection as the
parameter.
I did a tblimp (I get the same results if I add the COM
object as a reference) on the COM object and when I use
this in .NET, the same method has a signature of: saveMemo
(Object) and the Object is passed ByRef.
I tried this code:
dim col as collection
col.Add("Memo text")
dim obj as object = CType(col, Object)
saveMemo(obj)
This produced the error:
COMException(0x800A000D): Type mismatch
Microsoft knowledge base article 317887 references this
error as a bug (.NET method that takes a ByRef value type
parameter fails when you pass a variant type), but I'm not
sure how this relates to my problem. I'm not passing any
variant types. This is the only documentation I could find
on this error.
Can someone help me figure out what to pass to this method
that will work?
Thanks.