Bug in COM Interop

  • Thread starter Thread starter George A. Losenkov
  • Start date Start date
G

George A. Losenkov

Hi everybody.

I try to create COM server. I have interface
interface Font
{
...
object Color { get; set; }
...
}
I expect that i will see
interface Font : IDispatch {
....
[id(0x60020004), propget]
HRESULT Color([out, retval] VARIANT* pRetVal);
[id(0x60020004), propput]
HRESULT Color([in] VARIANT pRetVal);
....
}
But when I open autogenerated type liblary in OLE/COM Object Viewer I see
following
interface Font : IDispatch {
....
[id(0x60020004), propget]
HRESULT Color([out, retval] VARIANT* pRetVal);
[id(0x60020004), propputref]
HRESULT Color([in] VARIANT pRetVal);
....
};
Does anybody know why?
 
George,

This definitely seems like a bug. I tested it out on my machine (along
with some different interop attributes) and I couldn't work around it. I
would report it to MS (I will do so as well).

In the meantime, I would recommend that you define this interface in IDL
and then import it into your assembly.

Hope this helps.
 
Why is this a bug, your property is of type object, I think propputref
instead of propput is right here?
 
Back
Top