WriteFile
Top  Previous  Next

Description

Transfers the indicated amount of bytes from the data array in memory to the specified file in the device.


Syntax


[VB]
objActiveGige.WriteFile Name, Offset, Length, Data


[C/C++]
HRESULT WriteFile( bstr Name, long Offset, long Length, VARIANT Data );


Data Types
[VB]

Name: String
Offset: Long
Length: Long
Data: Variant (Array of Bytes)

Parameters
[C/C++]

Name [in]  
String specifying the name of the file in the device  
Offset [in]  
The transfer starting position from the beginning of the file in bytes  
Length [in]  
The number of bytes to transfer to the specified file  
Data [in]  
Pointer to SAFEARRAY of bytes containing data to be transferred to the file  


Return Values


S_OK  
Success  
E_NOINTERFACE        
File with the specified name does not exist in the device  
E_FAIL  
Failure.  


Example


This VB example reads a LUT array from the file on the device, inverts it and writes back to the device

w = ActiveGige1.ReadFile("LUTArray1", 0, 256)

For
 y = 0 To 255

w(y) = 255- w(y)

Next
ActiveGige1.WriteFile "LutArray1",0,256,w


Remarks


The File Access functionality allows an application to read and write files hosted on the device. The data in those files may contain look-up tables, configuration sets, firmware, and other information.

You can use the WriteFile method to transfer the content of a file on a hard drive to the file in the device. Note that in order for this method to work, the Access Mode of the file should be "W" or "RW".