L_AutCreate

Summary

Creates an automation handle.

Syntax

#include "ltaut.h"

L_LTAUT_API L_INT L_AutCreate(pAutomation, nMode, dwFlags)

Parameters

pAUTOMATIONHANDLE pAutomation

Pointer to an automation handle.

AUTOMATIONMODE nMode

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

L_UINT32 dwFlags

Reserved for future use. Use 0.

Returns

Value Meaning
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

See Also

Functions

Topics

Example

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;  
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Container and Automation C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.