![]() |
MKI_ProfileDrawingGetData (Settings) Changed in Version 2019.0 |
www.CAD6.com |
C++ Syntax__int32 MKI_ProfileDrawingGetData( __int16 f_nOwnerID, __int32 f_nProfileID, void* f_pProfileData, const size_t f_unMaxSize );
Retrieves a plug-in's binary data profile that has been stored in a drawing.
ParametersOwnerID [__int16] This value is a unique identification of the creator of the plug-in. The value MKI_DB_OWNER_MK is reserved for use by Malz++Kassner. Valid range: 0 <= Value < 10000. Third-party vendors that plan to implement a plug-in should contact Malz++Kassner to receive their unique identification (see Getting Your Private Owner ID). ProfileID [__int32] This value is used to identify the profile for further access. Each plug-in creator can use the full range of the value, as it is used in combination with his OwnerID. Usually, this value will be equal to the plug-in's ID. As this value is a 32bit value (rather than being a 16bit value like the plug-in's ID), each plug-in can store multiple profiles. In order to do so, store the plug-in's ID in the low-word of ProfileID, and an additional number in its high-word. ProfileData [void*] Address of a buffer to receive the profile data. If this value is nullptr, only the size of memory required to store the profile data is determined and returned. MaxSize [const size_t] Size of the buffer pointed to by ProfileData. The maximum size of a profile is 64000 bytes.
Return ValueReturns the size of the profile data in bytes. If the desired profile does not exist, the return value is 0. If the buffer is not large enough to receive the profile data, the return value negative and no data is copied.
CommentIn order to keep track of several versions, we strongly recommend that the data stored as profile contains a unique identifier that allows the plug-in to know which plug-in version created that profile data. We usually add a time stamp as first element to each structure we store in the registry:
class CProfileData { public:
MKI_STR32A m_szTimeStamp;
// ...Further Structure Elements... };
Inside the plug-in, the time stamp is defined as a string that is updated each time the structure CProfileData is changed. A standard time stamp might be:
constexpr LPSTR MY_PLUGIN_ID = "1.00-2022-06-01";
This is the time stamp of version 1.00, the last change was on June 1, 2022.
When saving a profile, the TimeStamp element should be initialized with MY_PLUGIN_ID. When reading a profile, the plug-in can use the TimeStamp element to verify whether it can interpret this data or not. If not, the plug-in may silently use the default settings without further notice to the user.
|
CAD6interface 2025.0 - Copyright 2025 Malz++Kassner® GmbH