#include "ltaut.h"
L_LTAUT_API L_INT L_AutCreate(pAutomation, nMode, dwFlags)
Creates an automation handle.
Pointer to an automation handle.
An AUTOMATION_MODE value that represents the automation mode to use when creating the automation handle.
Reserved for future use. Use 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
L_AutInit must be called before calling this function.
Required DLLs and Libraries
This example shows the minimum requirement to create a Vector Automation.
L_INT AutCreateExample(HWND hWnd,
pAUTOMATIONHANDLE * ppAutomation,
pTOOLBARHANDLE * ppToolbar)
{
L_INT nRet = SUCCESS;
if(*ppAutomation == NULL)
{
nRet = L_AutInit ( ppAutomation );
if (SUCCESS == nRet ) /* initiate the automation */
{
/* create the vector automation */
nRet = L_AutCreate ( *ppAutomation, AUTOMATION_MODE_VECTOR, 0 );
if ( SUCCESS != nRet )
{
MessageBox ( hWnd, TEXT("Error creating Vector Automation"), TEXT("Error:"), MB_ICONSTOP ) ;
L_AutFree ( ppAutomation ) ;
return nRet;
}
}
else
{
MessageBox ( hWnd, TEXT("Error Initializing Vector Automation"), TEXT("Error:"), MB_ICONSTOP ) ;
return nRet;
}
}
/* initiate the toolbar */
if(*ppToolbar == NULL)
{
nRet = L_TBInit ( ppToolbar );
if ( SUCCESS == nRet )
{
POINT pt = { 0, 0 } ;
ClientToScreen ( hWnd, &pt ) ;
/* create the vector toolbar */
nRet = L_TBCreate ( *ppToolbar, hWnd, TEXT("Vector "), TOOLBAR_VECTOR ) ;
if(nRet != SUCCESS)
return nRet;
/* set the toolbar position */
nRet = L_TBSetPosition ( *ppToolbar, &pt, TOOLBAR_POSITION_TOP | TOOLBAR_POSITION_LEFT ) ;
if(nRet != SUCCESS)
return nRet;
/* set the toolbar visible */
nRet = L_TBSetVisible ( *ppToolbar, TRUE ) ;
if(nRet != SUCCESS)
return nRet;
}
else
{
return nRet ;
}
}
/* set the automation toolbar */
nRet = L_AutSetToolbar ( *ppAutomation, *ppToolbar ) ;
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}