Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

ARES Kudo provides a C++ plugin which lets you create third party Plugin Software for ARES Kudo.

The CFx examples are in the following folder: "\ARES Kudo Server\SDK_x64\Samples\CFx\".
Create the solution by using cmake.Windows: Compiling Samples

Follow the steps described in “How to Create a Sample C++ plugin and build , load the plugin”.

New Project

Add a new C++ Empty project using Visual Studio 2022 as SampleCommand in ‘\ARES Kudo Server\SDK_x64\Samples\CFx’.

image-20240611-051220.png

Header Section

Create the following header files.          

SampleCommand.h

Creates the SampleCommand class with global and local command name. 

#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);
};

SampleCommandModule.h

Creates a new module for the SampleCommand class with initApp, uninitApp, and object that represents 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;
};

stdafx.h

Includes all the standard system include files/project specific include files that are frequently used

#include <windows.h>
#include "OdaCommon.h"

Source File Section

Create the following CPP files.

SampleCommand.cpp

CPP file for creating commands that you can call from ARES Kudo.

#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");
}

SampleCommandModule.cpp

Defines entry points for the dynamic library (TX = DLL). 

#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");
}

stdafx.cpp

Source file that includes just the standard include files.

#include "stdafx.h"

Project Settings

Do the following settings to make the C++ sample plugin to work.

  1. Open SampleCommand Property Page and do the following settings:

    1. In Configuration: Release

    2. In Platform: Choose the appropriate platform (in this example, it is x64).

  2. Specify Additional Include and Library Directories: Include libraries and include files from ARES Kudo SDK folder.
    Include files can be found in C:\Program Files\Graebert GmbH\ARES Kudo Server\SDK_x64\Headers\*.
    and C:\Program Files\Graebert GmbH\ARES Kudo Server\SDK_x64\Libraries\*

    image-20240611-051830.pngimage-20240611-051848.png

  1. Specify Additional Dependencies: Link appropriate libraries that implement ARES Kudo plugin API. Libraries can be found in C:\Program Files\Graebert GmbH\ARES Kudo Server\SDK_x64\Libraries\*.

image-20240611-052016.png
  1. Change extension of output and other properties as in the image below:
    The name of the shared library containing the subclass of OdRxModule should be according to the rule: <application name>.tx.

image-20240611-053145.pngimage-20240611-053218.png
  1. Define _TOOLKIT_IN_DLL macro in preprocessor:

    image-20240611-053552.png
image-20240611-053428.png
  1. Open SampleCommand property page and set C/C++ → Language → Treat WChar_t As Built in Type to Yes(/Zc:wchar_t-).

image-20240611-053934.png
  1. Navigate to the C:\Program Files\Graebert GmbH\ARES Kudo Server\Kudo\Bin\editor.dir\ and find the files named TD_Db_*.dll:
    In our example, the file name is TD_Db_4.03_17.dll. Add the _4.03_17 suffix to your output .dll name to load it normally.

    image-20240611-054614.png

Building

Build the SampleCommand project, and load it in Ares Kudo Load modules/plugins (.tx)

In our example, we have SampleCommand_4.03_17.tx as result.

  • No labels