L_AutCreate

#include "ltaut.h"

L_LTAUT_API L_INT L_AutCreate(pAutomation, nMode, dwFlags)

pAUTOMATIONHANDLE pAutomation;

/* pointer to an automation handle */

AUTOMATIONMODE nMode;

/* automation mode */

L_UINT32 dwFlags;

/* reserved */

Creates an automation handle.

Parameter

Description

pAutomation

Pointer to an automation handle.

nMode

An value that represents the automation mode to use when creating the automation handle, enumerated as AUTOMATION_MODE.

dwFlags

Reserved for future use. Use 0.

 

 

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

L_AutInit must be called before calling this function.

Required DLLs and Libraries

LTAUT

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

L_AutInit, L_AutFree

Topics:

Initializing, Creating and Freeing Automation Handles

Example

This example shows the minimum requirement to create a Vector Automation.

 
 L_INT AutCreateExample(HWND hWnd,
   pAUTOMATIONHANDLE * ppAutomation,
   pTOOLBARHANDLE * ppToolbar)
{
   L_INT nRet;
   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 */
   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; 
}