ARES commander provides C++ plugin which lets you author third party Plugin Software for ARES Commander.
...
1. SampleCommand.h - Create SampleCommand class with global and local command names
#include "FxCommand.h"
#include "FxCommandContext.h"
#include "FxUserIO.h"
class SampleCommand
{
public:
/** Description:
Sets non-localized version of the command name.
*/
virtual const OdString globalName() const;
/** Description:
Sets localized version of the command name.
*/
virtual const OdString localName() const;
~SampleCommand(void);
protected:
SampleCommand(void);
};
2. SampleCommandModule.h - Create a new module for SampleCommand with InitApp, uninitapp and object to represent the command
...
#include <RxModule.h>
#include <StaticRxObject.h>
#include "SampleCommand.h"
/** Description:
Creates a new module for Sample command.
*/
class CHelloCommandModule : public OdRxModule
{
public:
~CHelloCommandModule() {}
protected:
CHelloCommandModule() {}
/** Description:
Adds new command to the current module.
*/
virtual void initApp();
/** Description:
Removes command from the current module.
*/
virtual void uninitApp();
private:
/** Description:
Object from type sampleCommand is created. It represents the new command.
*/
OdStaticRxObject<SampleCommand> m_SampleCommand;
};
3. stdafx.h - File to include all the standard system include files/project specific include files that are frequently used
...
#include <windows.h>
#include "OdaCommon.h"
- Source Files : Create the following C++ files :
1.SampleCommand.cpp - cC++ file to create commands that can be called from ARES commander
#include "stdafx.h"
#include "SampleCommand.h"
#include "FxSystemServices.h"
SampleCommand::SampleCommand(void)
{
GetFxSystemServices()->WriteLine(L"HI, This is a Sample command.");
}
SampleCommand::~SampleCommand(void)
{
}
const OdString SampleCommand::globalName() const
{
// global command name to be called
return("MYSAMPLE");
}
const OdString SampleCommand::localName() const
{
// local command name to be called
return("MYSAMPLE");
}
2. SampleCommandModule.cpp - Defines entry and end point for the DLL application
#include "stdafx.h"
#include "SampleCommandModule.h"
#include <RxDynamicModule.h>
#include "FxSystemServices.h"
#ifdef _MANAGED
#pragma managed(push, off)
#endif
ODRX_DEFINE_DYNAMIC_MODULE(CHelloCommandModule);
void CHelloCommandModule::initApp()
{
GetFxSystemServices()->WriteLine(L"SampleCommandModule initApp");
}
void CHelloCommandModule::uninitApp()
{
GetFxSystemServices()->WriteLine(L"SampleCommandModule uninitApp");
}
4. stdafx.cpp - source Source file that includes just the standard includes files
#include "stdafx.h"
Now for the C++ sample plugin to work certain configurations has to be done.
...
- Additional Dependencies: linking Linking appropriate libraries that implement ARES Commander plugin API. Libraries are located on your drive,
...
The shared library containing the subclass of OdRxModule, should be named < application name >.tx.
- Define _TOOLKIT_IN_DLL macro
...
Go to C:\Program Files\Graebert GmbH\ARES Commander 20**\BIN and find the files named TD_Db_*.dll;
In our example, it is named TD_Db_4.03_14.dll. You must add the suffix _4.03_14 to your output .dll name to make it load normally.
- Build SampleCommand project and Open ARES Commander and use the APPLOAD command to load your application:
In our example, we have SampleCommand_4.03_14.tx as result.
...