Desktop version

Main > Knowledge Base > 1C:Enterprise documentation > Add-in Development Technology > Creating add-ins with Native API technology > 1C:Enterprise interface > 1C:Enterprise documentation > Add-in Development Technology > Creating add-ins with Native API technology > 1C:Enterprise interface > 1C:Enterprise documentation > Add-in Development Technology > Creating add-ins with Native API technology > 1C:Enterprise interface

1C:Enterprise interface

During the initialization of the add-in object, the pointer to 1C:Enterprise interface is passed to it. You can use the pointer to call the methods listed in this section. Note that these methods will not work at 1C:Enterprise server side.

AddError

Description:

Adds a message that can be displayed during the execution of 1C:Enterprise script extension methods. If the scode is not equal to 0, an exception is generated. You can catch and handle the exception using 1C:Enterprise script.

Possible message codes and 1C:Enterprise behavior are described in section Notification messages about object states.

Syntax:

bool AddError(unsigned short wcode, const WCHAR_T* source, const WCHAR_T* descr, long scode);

Parameters:

wcode

Type: unsigned short. Message code.

source

Type: const WCHAR_T*. Error source.

descr

Type: const WCHAR_T*. Error message.

scode

Type: long. Error code.

Return value:

RegisterProfileAs

Description:

Registers the list of add-in parameters with name wsProfileName.

Syntax:

bool RegisterProfileAs(WCHAR_T* wsProfileName);

Parameters:

wsProfileName

Type: WCHAR_T*. Name of the add-in parameter list.

Return value:

Read

Description:

Reads the add-in parameter value stored in pszPropName. If the value cannot be read and errDescriptor value is not NULL, 1C:Enterprise allocates memory and writes the error description to that memory. The add-in must release the memory by calling FreeMemory(). For return values of string type, 1C:Enterprise also allocates memory and saves the address in the corresponding field of the tVariant structure. The add-in must release that memory by calling FreeMemory().

Syntax:

bool Read(WCHAR_T* pszPropName, tVariant* pVal, long* pErrCode, WCHAR_T** errDescriptor);

Parameters:

pszPropName

Type: WCHAR_T*. Parameter name.

pVal

Type: tVariant*. Pointer to the parameter value.

pErrCode

Type: long*. Pointer to the variable that will store the error code if an error occurs.

errDescriptor

Type: WCHAR_T**. Double pointer to the variable that will store the error description.

Return value:

Write

Description:

Saves the add-in parameter value to pszPropName.

Syntax:

bool Write(WCHAR_T* pszPropName, tVariant* pVar);

Parameters:

pszPropName

Type: WCHAR_T*. Parameter name.

pVar

Type: tVariant*. Pointer to the parameter value.

Return value:

SetEventBufferDepth

Description:

Sets the event queue size for the specified object. If the number of events exceeds the specified queue size, the latest events are deleted.

Syntax:

bool SetEventBufferDepth(long lDepth);

Parameters:

lDepth

Type: long. Event queue size.

Return value:

GetEventBufferDepth

Description:

Returns the event queue size for the specified object.

Syntax:

long GetEventBufferDepth();

Return value:

Event queue size.

ExternalEvent

Description:

Adds the event (its source, name, and parameters) to the queue. During the event processing, that data is passed to the ExternalEventProcessing() procedure. When the ExternalEvent() method is called, further event processing is performed as follows: the event is added to the queue (if the queue is full, the event is lost), then, if no system events are available and the queue is not empty, external event processing is started for the first event in the queue. This process is repeated for all add-in objects. This synchronizes external event processing with system event processing.

Syntax:

bool ExternalEvent(WCHAR_T* wsSource, WCHAR_T* wsMessage, WCHAR_T* wsData);

Parameters:

wsSource

Type: WCHAR_T*. String that stores the event source name

wsMessage

Type: WCHAR_T*. String that stores the event name.

wsData

Type: WCHAR_T*. String that stores the event parameters.

Return value:

CleanEventBuffer

Description:

Clears the event queue by deleting all events from it.

Syntax:

void CleanEventBuffer();

Return value:

None.

SetStatusLine

Description:

Sets the status bar text (displayed at the bottom part of the 1C:Enterprise window).

Syntax:

bool SetStatusLine(WCHAR_T* wsStatusLine);

Parameters:

wsStatusLine

Type: WCHAR_T*. Status bar text.

Return value:

ResetStatusLine

Description:

Clears the status bar.

Syntax:

void ResetStatusLine();

Return value:

None.

GetInterface

Description:

Requests the platform interface.

Syntax:

IInterface* GetInterface(Interfaces iface)

Parameters:

iface

Type: Interfaces. The value of the Interfaces enumeration: eIMsgBox or eIPlatformInfo.

Return value:

Confirm

Description:

Displays a dialog box with text specified in queryText and buttons OK and Cancel.

Syntax:

bool Confirm(const WCHAR_T* queryText, tVariant* retVal)

Parameters:

queryText

Type: WCHAR_T*. Question text.

retVal

Type: tVariant*. Return value of the dialog box, which has VTYPE_BOOL type: true for clicking OK, or false for clicking Cancel.

Return value:

Alert

Description:

Displays a simple notification dialog box with text specified in text and OK button.

Syntax:

bool Alert(const WCHAR_T* text)

Parameters:

text

Type: WCHAR_T*. Message text.

Return value:

GetPlatformInfo

Description:

Requests platform info. If the add-in is attached to 1C:Enterprise version earlier than 8.3.3 using a web client, only the Application field of the AppInfo structure is filled.

Syntax:

AppInfo* GetPlatformInfo()

Return value:

Next page: Mapping between tVariant and 1C:Enterprise types




© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.