LVectorFile::LVectorFile

#include "ltwrappr.h"

L_VOID LVectorFile::LVectorFile(L_VOID)

L_VOID LVectorFile::LVectorFile(pLVector)

L_VOID LVectorFile::LVectorFile(pLVector, pFileName)

LVectorBase L_FAR * pLVector;

/* pointer to a LEAD vector object */

L_TCHAR L_FAR * pFileName;

/* file name */

Constructs and initializes the member variables of the class object.

Parameter

Description

pLVector

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

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

LVKRN
LTFIL

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:

LVectorFile::~LVectorFile, Class Members

Example

This is an example for LVectorFile::LVectorFile():

L_VOID Example45(HWND hWnd)
{
   RECT rect;

   LVectorBase Vector;
   LVectorFile VectorFile;

   VectorFile.SetVector(&Vector);
   VectorFile.SetFileName(TEXT("s:\\temp\\images\\dxf\\test.dxf"));
   VectorFile.LoadFile();

   Vector.AttachToWindow(hWnd);
   GetClientRect(hWnd, &rect);
   Vector.SetViewport(&rect);

   VectorFile.SetFileName(TEXT("d:\\image3.wmf"));
   VectorFile.SaveFile(FILE_WMF);
}

This is an example for LVectorFile::LVectorFile(pLVector):

L_VOID Example44(HWND hWnd)
{
   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(TEXT("s:\\temp\\images\\dxf\\test.dxf"));
   VectorFile.LoadFile();

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

This is an example for LVectorFile::LVectorFile(pLVector, pFileName):

L_VOID Example46(HWND hWnd)
{
   LVectorBase Vector;
   LVectorFile VectorFile(&Vector, TEXT("s:\\temp\\images\\dxf\\test.dxf"));

   VectorFile.LoadFile();

   //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;
   VectorFile.GetFileName(szTemp, &uBuffSize);
   MessageBox(hWnd, szTemp, TEXT(""), MB_OK);
}