LAutomation::Create

#include "ltwrappr.h"

L_INT LAutomation::Create(nMode, dwFlags=0);

Creates an automation handle.

Parameters

AUTOMATIONMODE nMode

An integer value that represents the automation mode to use when creating the automation handle. Possible values are:

Value Meaning
AUTOMATION_MODE_PAINT Creates an automation handle for digital paint.
AUTOMATION_MODE_VECTOR Creates an automation handle for Vectors.

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

LAutomation::Initialize must be called before calling this function.

If vector viewing support is unlocked using L_SUPPORT_VECTOR_VIEW, this function will return ERROR_VECTOR_LOCKED, if nMode is set to AUTOMATION_MODE_VECTOR.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example shows the minimum requirements for creating a Vector Automation.

L_INT LAutomation_CreateExample( HWND hWnd , LAutomation & lauto, pTOOLBARHANDLE g_pToolbar, LToolbar & tlb)  
{ 
   UNREFERENCED_PARAMETER(g_pToolbar); 
 
   L_INT nRet; 
 
   nRet = lauto.Initialize (); 
 
   if (SUCCESS == nRet ) /* initiate the automation */ 
 
   { 
 
      /* create the vector automation */ 
 
      nRet = lauto.Create (AUTOMATION_MODE_VECTOR, 0 ); 
 
      if ( SUCCESS != nRet )  
 
      { 
 
         ::MessageBox ( hWnd, TEXT("Error creating Vector Automation"), TEXT("Error:"), MB_ICONSTOP ) ; 
 
         nRet = lauto.Free() ; 
         if(nRet != SUCCESS) 
            return nRet; 
 
         return nRet; 
 
      } 
 
   } 
 
   else 
 
   { 
 
      ::MessageBox ( hWnd, TEXT("Error Initializing Vector Automation"), TEXT("Error:"), MB_ICONSTOP ) ; 
 
      return nRet;  
 
   } 
 
   /* initiate the toolbar */ 
 
   nRet = tlb.Initialize (); 
 
   if ( SUCCESS == nRet ) 
 
   { 
 
      POINT pt = { 0, 0 } ; 
 
      ::ClientToScreen ( hWnd, &pt ) ; 
 
      /* create the vector toolbar */ 
 
      nRet = tlb.Create (hWnd, TEXT("Vector Automation"), TOOLBAR_VECTOR ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* set the toolbar position */ 
 
     nRet = tlb.SetPosition (&pt, TOOLBAR_POSITION_TOP | TOOLBAR_POSITION_LEFT ) ; 
     if(nRet != SUCCESS) 
        return nRet; 
 
      /* set the toolbar visible */ 
 
      nRet = tlb.SetVisible (TRUE ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
 
   else 
 
   { 
 
      return nRet ; 
 
   } 
 
   /* set the automation toolbar */ 
 
   nRet = lauto.SetToolbar (&tlb ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS ; 
 
} 

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

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