Message 1 of 1
COM Properties: "Standard" Properties - how to make them work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My custom object has a extra set of standard properties (line colour, layer, linetype and lineweight) that I'm trying to expose in the COM properties panel. I can only get it to partially work.
I have:
// IDL
[propget, id(DISPID_IENT_WTLAYER), helpstring("Layer")] HRESULT WTLayer([out, retval] ACAD_LAYER* pVal);
[propget, id(DISPID_IENT_WTCOLOR), helpstring("Color")] HRESULT WTColor([out, retval] IAcadAcCmColor** pVal);
[propget, id(DISPID_IENT_WTLT), helpstring("Linetype")] HRESULT WTLinetype([out, retval] ACAD_LTYPE* pVal);
[propget, id(DISPID_IENT_WTLW), helpstring("Lineweight")] HRESULT WTLineweight([out, retval] ACAD_LWEIGHT* pVal);
// .H / .CPP
STDMETHOD(get_WTLayer)(/*[out, retval]*/ ACAD_LAYER* pVal);
STDMETHOD(get_WTColor)(/*[out, retval]*/ IAcadAcCmColor** pVal);
STDMETHOD(get_WTLinetype)(/*[out, retval]*/ ACAD_LTYPE* pVal);
STDMETHOD(get_WTLineweight)(/*[out, retval]*/ ACAD_LWEIGHT* pVal);
- The colour property works, in that I get into the handler, but I don't understand how to assign my colour to the argument. Anyone know how to do this?
- I get into the layer property handler, assign the string, but nothing appears in the panel
- The lineweight handler works as expect and displays correctly.
- I never hit the linetype handler and as such, nothing is displayed.
Now I can change the types for the layer and linetype to BSTR, which works, but if I ever make my properties not read-only, I'd want to use the standard linetype picker, and this approach stops that from working.
TLDR: What is the proper way to expose 'standard' properties, with the appropriate picker controls, in the COM property panel?