Below is the code for a simple DLL. See at the end for a video walk through of the full process. This DLL just adds one command, "Test", which takes one text argument, and prints it out to the Gui4cli output window.
This is the full code for the DLL. The only other files you need are a "DEF" file, defining the exports (see below) and the G4C_api.h include file, which contains the main structures (in case you want to access them) and typefs for the various Gui4Cli helper functions you can call. Note that when calling dlls from within Gui4Cli, you don't need to "import" them etc. You just copy the DLL into the DLL folder and use dll_name.command. Gui4Cli will find the dll, load it if it needs it and unload it when it's done. In this case, if we call this dll "simple.dll" we would access the commands in it from any gui with:
simple.test "Some text to print out"
This is the full code for the DLL. The only other files you need are a "DEF" file, defining the exports (see below) and the G4C_api.h include file, which contains the main structures (in case you want to access them) and typefs for the various Gui4Cli helper functions you can call. Note that when calling dlls from within Gui4Cli, you don't need to "import" them etc. You just copy the DLL into the DLL folder and use dll_name.command. Gui4Cli will find the dll, load it if it needs it and unload it when it's done. In this case, if we call this dll "simple.dll" we would access the commands in it from any gui with:
simple.test "Some text to print out"
The DEF file for the above DLL
Code Editor
Below is a full walk-through for creating the "simple.dll" described here above.