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)

   

Parameters

guid

Pointer to a GUID that identifies the plug-in to which the message is addressed, except when the message is AME_ENUMERATE.

Mesg       

One of the AME_xxx message constants.

wParam     

Depends on the message, but typically used for integer parameters.

lParam     

Depends on the message, but typically a pointer to a buffer.

Return

One of the AME_xxx return codes:

AME_OKThe message was processed successfully
AME_NOTIMPLEMENTEDThe plug-in does not implement the functionality of the passed message. For example, a plug-in which has no settings should return AME_NOTIMPLEMENTED to an AME_EDITSETTINGS message. This return code is also used to end enumeration (see remarks).
AME_ERRORAn error occurred during the processing of the message. ANY-maze will log the error in the ANYmazeLog.txt file.
AME_CANCELLEDThe message processing was cancelled by the user. For example, if the user closes a settings window by clicking a Cancel button, the plug-in should return AME_CANCELLED. This return code is also used as a response to AME_TESTEND, to signal that any results from this plug-in recorded by ANY-maze for the test that has just ended should be deleted.

Remarks

This 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