Creating add-ins with Native API technology





Use this technology to create add-ins that can be attached to client applications and 1C:Enterprise servers on Windows, Linux, Windows Runtime, Android, and iOS platform versions.

The user interface is not available for Windows Runtine, Android, and iOS.

An add-in implements one or several objects availlable for use from 1C:Enterprise. Each add-in object must inherit the IComponentBase abstract class and implement all of its methods. The ComponentBase.h file is included in the distribution kit.

An add-in developed using this technology must export the following four functions from the library:

GetClassNames

Description:

Gets the list of add-in object names.

Syntax:

const WCHAR_T* GetClassNames();

Return value:

An array with a list of add-in object names.

GetClassObject

Description:

Creates an instance of the add-in object.

Syntax:

long GetClassObject(const WCHAR_T* clsName, IComponentBase** pIntf);

Parameters:

clsName

Type: const WCHAR_T*. Name of the object being created.

pIntf

Type: IComponentBase**. Pointer to the variable that will store the address of the created object.

Return value:

  • 0 - the object cannot be created or the object with the specified name is not found.
  • nonzero value - the object is created.

DestroyObject

Description:

Deletes an instance of a previously created object. The add-in must delete the object and release the memory using its own tools.

Syntax:

long DestroyObject(IComponentBase** pIntf);

Parameters:

pIntf

Type: IComponentBase**. Pointer to the add-in object.

Return value:

  • 0 - successful completion.
  • error code (Runtime error) - errors occurred.

SetPlatformCapabilities

Description:

Sets the version of supported platform capabilities. If the function is not implemented, the add-in cannot display messages and request platform information. 

Syntax:

AppCapabilities SetPlatformCapabilities(const AppCapabilities capabilities);

Parameters:

capabilities

Type: AppCapabilities enumeration. Enumeration values: eAppCapabilitiesInvalid = -1, eAppCapabilities1 = 1, eAppCapabilitiesLast = eAppCapabilities1. 

Return value

The version of supported platform capablities. 


Comments
0
Add comment