Specifics of add-in development using Native API





Add-ins developed using this technology are platform-dependent. Therefore, you have to build add-in versions for both x86 and x86-64 platforms. Configuration developers are responsible for defining the platform type and loading the appropriate add-in versions.

An add-in can be loaded to a 1C:Enterprise application server that is running on any of the available operating systems, so we recommend that you create a cross-platform implementation.

1C:Enterprise supports Unicode (WCHAR_T) string format with 2 bytes per character. This length is equal to that of wchar_t type on Windows. However, it might be different on other operating systems where the wchar_t size can be 4 bytes. This is why you have to implement the conversion for character data of this type.

If an add-in uses additional modules, describe them in the add-in documentation. We recommend that you statically include required nonsystem runtime libraries in your add-in (provided that the library licenses permit this option) because they might not be available on the end-user computer, or an end user might have different versions of these libraries installed. Also, include a manifest file in Windows add-in versions.

Ensure that each exception is caught and processed in your add-in, and then the exception info is passed to 1C:Enterprise using the AddError() method.

If an add-in is running on a 1C:Enterprise server, external events are not processed. Also, methods that manage the status bar or save any parameters are not processed.

An add-in can return any binary data, for example, a generated barcode image. For that purpose, store data in the pstrVal field of the tVariant structure, store data length in the strLen field, and set data type to VTYPE_BLOB. 1C:Enterprise uses the BinaryData type for this data type.

Pass date values to your add-in as tm structures with VTYPE_TM type. The add-in can return date values both as struct tm or as Windows DATE values with VTYPE_DATE type (1C:Enterprise will process it correctly).

Warning! Return values of VTYPE_ARRAY and VTYPE_BYREF types are not suported.


Comments
0
Add comment