|
ANY-maze Help > The ANY-maze reference > ANY-maze plug-ins > Plug-in API reference > AME_ENUMERATE message AME_ENUMERATE message
The AME_ENUMERATE message is used to enumerate the plug-ins implemented by a plug-in DLL. Remember, a single DLL can implement multiple plug-ins. ParametersguidPointer to GUID_NULL when enumeration is starting. Pointer to the previous GUID returned when enumeration is continuing. See Remarks section, below. wParamThis is the version of ANY-maze that is being used. Versions are coded as a DWORD value with the bytes (high to low) as, for example, 0,4,7,7 for version 4.77. If your plug-in will only work with a certain version of ANY-maze, then you should check this value and return AME_NOTIMPLEMENTED if the version is inappropriate for your plug-in. lParamPointer to a GUID. The DLL code should set the GUID pointed to by this parameter to the GUID of the next plug-in it implements.
*((LPGUID)lParam) = GUID_MYPLUGIN;
Return valueThe only valid return codes from this message are:
If the code has set the GUID pointed at by lParam, then return AME_OK. If the code has returned all the GUIDs implemented by the DLL, then return AME_NOTIMPLEMENTED. If an error occurs, return AME_ERROR. RemarksWhen an enumeration is starting, the guid parameter will point to GUID_NULL. The DLL code should detect this, set the GUID pointed at by the lParam to the GUID of the first plug-in it implements, and return AME_OK. ANY-maze will then send this message to the plug-in again, this time with the guid parameter set to the GUID returned by the previous message. The DLL code should detect this, set the GUID pointed at by the lParam to the GUID of the next plug-in it implements, and return AME_OK. When the DLL code has returned the GUID of all the plug-ins it implements, it should return AME_NOTIMPLEMENTED to end the enumerations. Example code for a DLL which implements a single plug-in.
if (*guid == GUID_NULL) { //Enumeration is starting - return our GUID *((LPGUID)lParam) = GUID_MYPLUGIN; return AME_OK; } else { //We only implement a single plug-in, so we're done return AME_NOTIMPLEMENTED; }
Example code for a DLL which implements three plug-ins.
if (*guid == GUID_NULL) *((LPGUID)lParam) = GUID_1ST_PLUGIN; else if (*guid == GUID_1ST_PLUGIN) *((LPGUID)lParam) = GUID_2ND_PLUGIN; else if (*guid == GUID_2ND_PLUGIN) *((LPGUID)lParam) = GUID_3RD_PLUGIN; else return AME_NOTIMPLEMENTED; return AME_OK;
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T1008 |