Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
This page has been translated for your convenience with an automatic translation service. This is not an official translation and may contain errors and inaccurate translations. Autodesk does not warrant, either expressly or implied, the accuracy, reliability or completeness of the information translated by the machine translation service and will not be liable for damages or losses caused by the trust placed in the translation service.Translate
how to implement IPropertySource to add per-instance property?
how to implement IPropertySource to add per-instance property?
My code is based on Kean's article "Exposing AutoCAD's Properties Palette functionality to .NET".I expand it,wrapped IPropertySource,OPMPerInstancePropertyExtension,OPMPerInstancePropertyExtensionFactory,OPMPerInstancePropertySources in C#.All thing is right except IPropertySource.
Here is the IPropertySource interface source code:
{code}
interface DECLSPEC_UUID("61D0A8E3-C792-4956-8E96-594315B95902")
IPropertySource : public IUnknown
{
BEGIN_INTERFACE
// *** IUnknown methods ****
// Call this when your property changes
STDMETHOD(get_Name)(THIS_ /*[out, retval]*/BSTR* pName) PURE;
// Call to get the current selection set OPM is working with, returns a SAFEARRAY
// of LONGs representing the objectIDs of the set, be sure to call VariantClear to cleanup
STDMETHOD(GetProperties)(THIS_ /*[in]*/IUnknown* pObject, /*[out, retval]*/VARIANT *pPropertyArray) PURE;
};
{code}
Here is the document of GetProperties
The pProperties array contains pointers to IDynamicProperty instances that describe additional properties of the object. If the property source object does not generate any dynamic properties, pProperties can be VT_EMPTY or an empty array.
I declared like this
{code}
[InteropServices::Guid("61D0A8E3-C792-4956-8E96-594315B95902")]
[InteropServices::InterfaceTypeAttribute(InteropServices::ComInterfaceType::InterfaceIsIUnknown)]
[InteropServices::ComVisible(true)]
public interface class IPropertySource
{
//[return: MarshalAs(UnmanagedType::BStr)]
String^ get_Name();
//[return: MarshalAs(UnmanagedType::SafeArray, SafeArraySubType=VarEnum::VT_UNKNOWN)]
array
wrote in message news:6293566@discussion.autodesk.com...
My code is based on Kean's article "Exposing AutoCAD's Properties Palette
functionality to .NET".I expand it,wrapped
IPropertySource,OPMPerInstancePropertyExtension,OPMPerInstancePropertyExtensionFactory,OPMPerInstancePropertySources
in C#.All thing is right except IPropertySource.
Here is the IPropertySource interface source code:
{code}
interface DECLSPEC_UUID("61D0A8E3-C792-4956-8E96-594315B95902")
IPropertySource : public IUnknown
{
BEGIN_INTERFACE
// *** IUnknown methods ****
// Call this when your property changes
STDMETHOD(get_Name)(THIS_ /*[out, retval]*/BSTR* pName) PURE;
// Call to get the current selection set OPM is working with, returns a
SAFEARRAY
// of LONGs representing the objectIDs of the set, be sure to call
VariantClear to cleanup
STDMETHOD(GetProperties)(THIS_ /*[in]*/IUnknown* pObject, /*[out,
retval]*/VARIANT *pPropertyArray) PURE;
};
{code}
Here is the document of GetProperties
The pProperties array contains pointers to IDynamicProperty instances that
describe additional properties of the object. If the property source object
does not generate any dynamic properties, pProperties can be VT_EMPTY or an
empty array.
I declared like this
{code}
[InteropServices::Guid("61D0A8E3-C792-4956-8E96-594315B95902")]
[InteropServices::InterfaceTypeAttribute(InteropServices::ComInterfaceType::InterfaceIsIUnknown)]
[InteropServices::ComVisible(true)]
public interface class IPropertySource
{
//[return: MarshalAs(UnmanagedType::BStr)]
String^ get_Name();
//[return: MarshalAs(UnmanagedType::SafeArray,
SafeArraySubType=VarEnum::VT_UNKNOWN)]
array