C++ SDK

◆ OnMenuCommand()

static int CApplicationAPI::OnMenuCommand ( LpError  lpError,
int  nID,
int  nSubID,
BOOL  bShowApplication,
DWORD  dwMaxTime = DEFAULT_MAX_TIME 
)
static

The function provides direct access to menu items.

Parameters
lpErrorAdditional error information returned from Drive.
nIDMenu ID to which function provides access. Possible values are enumerated in ID enum.
Name of most of ID items is similar to name of menu displayed in screen top left corner. It is also similar to button name in main menu which opens corresponding menu.
bShowApplicationFlag determining whether Drive should be brought to foreground automatically.
true - Drive will be brought to foreground
false - Drive will stay in background
dwMaxTimeMaximum time (in milliseconds) function can take. If dwMaxTime=0 function execution is not time limited.
nSubIDMenu SubID corresponding to menu ID.
Name of most of SubID items is similar to name of corresponding button in corresponding menu (nID).
OnMenuCommand function calls function which is called after clicking this button.
Links to possible enums are listed in ID.

For example: if nID = ID::IdMEnuManagePoi nSubID must be chosen from IdMenuManagePoi enum.
Returns
1 if successful, other value otherwise.

Possible error codes returned from Drive are:

  • 0 - Function not succeeded.
  • 1 - Function succeeded.
  • 2 - Drive not succeeded.
  • 3 - Function reached timeout.