Com variant



Hi,

I'm calling a COM function on an IUnknown interface that returns a variant
as an object. The function is something like this:

[PreserveSig]
int ReadProperty(string PropName, out object PropValue);

On most of the calls it works fine but with one particular property it fails
saying that it cannot marshal the variant type. The variant is of type
VT_CLSID which is really just a pointer to a GUID so I would have thought it
would be able to do it. Is there a better way I should be doing this?

Thanks for any replies
Michael


.



Relevant Pages

  • Re: Comparing a variant string with char*
    ... I understand what you are saying, but the above code compiles and runs ... A VARIANT type is not a string, and is not comparable to a string; ... There is no VARIANT type that can represent a char string, for example, although there is ...
    (microsoft.public.vc.mfc)
  • Re: Increment a Variable?
    ... >> No, it does not have to be a Variant type, but you can't change data ... >> types with a redim unless the array is contained in a Variant. ... > Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)
  • Re: Invalid variant type conversion
    ... >> If there was no variant type, one would probably create one for ... who definately serve a purpose when you want to ... One may discuss the possible problem with coding with variants vs. the ... simple variant assignment may include 100's of instructions. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Using the $ after functions
    ... AnyString = "Hello World" ' Define string. ... I would not need to use the variant that defined how many characters from ... for query expressions - I suggest to use variant type ...
    (microsoft.public.access.modulesdaovba)
  • Re: Arrays. Beginners question!
    ... What Bob suggest is that instead of using a variant array, ... This is one of those cases when a variant type is your friend. ... Also note that Bob qualified the variant type by explicitly including "as variant" ...
    (microsoft.public.vb.general.discussion)