LVectorFile::LVectorFile

#include "ltwrappr.h"

LVectorFile::LVectorFile(L_VOID)

LVectorFile::LVectorFile(pLVector)

LVectorFile::LVectorFile(pLVector, pFileName)

Constructs and initializes the member variables of the class object.

Parameters

LVectorBase * pLVector

Pointer to a LEAD vector object, used to initialize the LVectorFile object.

L_TCHAR * pFileName

Character string that contains the name of the file.

Returns

None

Comments

LVectorFile::LVectorFile() is a constructor for the LVectorFile class.

LVectorFile::LVectorFile(pLVector) also sets the vector for the class object.

LVectorFile::LVectorFile(pLVector, pFileName) also sets the vector for the class object and the filename to associate with the object.

Required DLLs and Libraries

See Also

Functions

Example

// This is an example for LVectorFile::LVectorFile(): 
 
L_INT LVectorFile__LVectorFileExample_1(HWND hWnd) 
{ 
   L_INT       nRet; 
   RECT        rect; 
   LVectorBase Vector; 
   LVectorFile VectorFile; 
 
   VectorFile.SetVector(&Vector); 
 
   VectorFile.SetFileName(MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
 
   nRet = VectorFile.LoadFile(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = Vector.AttachToWindow(hWnd); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   GetClientRect(hWnd, &rect); 
 
   nRet = Vector.SetViewport(&rect); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   VectorFile.SetFileName(MAKE_IMAGE_PATH(TEXT("image3.wmf"))); 
 
   nRet = VectorFile.SaveFile(FILE_WMF); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
 
// This is an example for LVectorFile::LVectorFile(pLVector): 
 
L_INT LVectorFile__LVectorFileExample_2(HWND hWnd) 
{ 
   L_INT       nRet; 
   LVectorBase Vector; 
   LVectorFile VectorFile(&Vector); 
 
   //LVectorFile object is invalid until object and filename habe been associated 
   if (VectorFile.IsValid()) 
      MessageBox(hWnd, TEXT("IsValid() returns TRUE"), TEXT(""), MB_OK); 
   else 
      MessageBox(hWnd, TEXT("IsValid() returns FALSE"), TEXT(""), MB_OK); 
 
   VectorFile.SetFileName(MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
   nRet = VectorFile.LoadFile(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
    //LVectorFile object is invalid unless a file has been loaded 
   if (VectorFile.IsValid()) 
      MessageBox(hWnd, TEXT("IsValid() returns TRUE"), TEXT(""), MB_OK); 
   else 
      MessageBox(hWnd, TEXT("IsValid() returns FALSE"), TEXT(""), MB_OK); 
 
   //destructor called when out of scope 
 
   return SUCCESS; 
} 
 
// This is an example for LVectorFile::LVectorFile(pLVector, pFileName): 
L_INT LVectorFile__LVectorFileExample_3(HWND hWnd) 
{ 
   L_INT       nRet; 
   LVectorBase Vector; 
 
   LVectorFile VectorFile(&Vector, MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
 
   nRet = VectorFile.LoadFile(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   //Get pointer to internal file name 
   MessageBox(hWnd, VectorFile.GetFileName(), TEXT(""), MB_OK); 
 
   //Get copy of internal file name 
   L_TCHAR  szTemp[100]; 
   L_UINT   uBuffSize; 
 
   nRet = VectorFile.GetFileName(szTemp, &uBuffSize); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   MessageBox(hWnd, szTemp, TEXT(""), MB_OK); 
 
   return SUCCESS; 
} 
Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help