|
ANY-maze Help > The ANY-maze reference > ANY-maze plug-ins > Plug-in API reference > ANYmazeExtension_Main ANYmazeExtension_Main
ANYmazeExtension_Main is a routine defined in a plug-in which is used as the link between ANY-maze and a plug-in. All plug-ins must include this routine. Syntax
__declspec(dllexport) int ANYmazeExtension_Main (LPGUID guid, DWORD Mesg, WPARAM wParam, LPARAM lParam)
ParametersguidPointer to a GUID that identifies the plug-in to which the message is addressed, except when the message is AME_ENUMERATE. MesgOne of the AME_xxx message constants. wParamDepends on the message, but typically used for integer parameters. lParamDepends on the message, but typically a pointer to a buffer. ReturnOne of the AME_xxx return codes:
RemarksThis routine should be exported from your plug-in DLL. How you ensure that the routine is exported will depend on your linker and your preference (many linkers provide different ways to export routines). In Visual C++, the routine can be exported by declaring it as __declspec(dllexport). Care should be taken with the naming of this routine, as linkers will normally decorate the name. You should refer to your linker's help file for details on how to prevent name decoration, but for Visual C++, you can declare the function for C linkage by using extern "C" as in the following example:
extern "C" __declspec(dllexport) int ANYmazeExtension_Main (LPGUID guid, DWORD Mesg, WPARAM wParam, LPARAM lParam) { .... your code here... }
An easy way to check that your DLL is exporting this routine correctly is to use the DEPENDS.EXE utility from Microsoft and check the exports list; the routine should be shown with the name ANYmazeExtension_Main i.e. without any name decoration. When the message passed to this routine is AME_ENUMERATE, the guid parameter will initially point at the value GUID_NULL; the DLL should use this to determine that enumeration is starting and should return the GUID of the first plug-in it implements. ANY-maze will then send a second AME_ENUMERATE message, with the guid parameter pointing at the GUID that the DLL just returned; the DLL should detect this and return the GUID of the next plug-in it implements; and so on until the DLL has returned the GUIDs of all the plug-ins it implements. At this point, it should return AME_NOTIMPLEMENTED to end the enumeration. See Step-by-step instructions for more details, and an example implementation of AME_ENUMERATE processing.
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T1005 |