DioFileGetHandle

Applies To

File.

Purpose

Returns the handle to the specified file name previously opened using DioFileOpen command.

Syntax

DioFileGetHandle (sFullFilename, phFile, pnStatus)

Parameters

Name

Type

Comments

sFullFilenam

LPCSTR

The file full name including the complete path.

phFile

SHORT

Returns the specified File board handle.

pnStatus

SHORT

Returned status: 0 on success, negative number on failure.

Comments

The function is useful whenever editing more then one file at a time. The return File board handle gives the user the ability to flip between files while editing.

Example

The following example creates two DIO files, “File1.dio” and “File2.dio”, retrieves the File board handle for the first file, adds two boards to the file and closes the first file. It then retrieves the File board handle for the second file, adds two boards to the file and closes the second file.

 

SHORT nStatus, hFile, hFileBoard;

DioFileOpen (“File1.dio”, 1, &hFile, &nStatus);

DioFileOpen (“File2.dio”, 1, &hFile, &nStatus);

if (hFile1!=0 && nStatus==0)

{  /* retrieve the File board handle for the first file */

   DioFileGetHandle (“File1.dio”, &hFile, &nStatus)

   DioFileInsertBoard (hFile, 1, &hFileBoard, pnStatus)

   DioFileInsertBoard (hFile, 2, &hFileBoard, pnStatus)

   DioFileClose (hFile, &nStatus);

   /* retrieve the File board handle for the second file */

   DioFileGetHandle (“File2.dio”, &hFile, &nStatus)

   DioFileInsertBoard (hFile, 1, &hFileBoard, pnStatus)

   DioFileInsertBoard (hFile, 2, &hFileBoard, pnStatus)

   DioFileClose (hFile, &nStatus);

}

 

See Also

DioFileGetNumberOfSteps, DioFileOpen, DioFileClose, DioGetErrorString, DioFileGetBoardHandle