How to get file handle of file opened by VB? 
Author Message
 How to get file handle of file opened by VB?

Is it possible to get the file handle of a file opened by VB under Win32?
 I'd like to use FlushFileBuffers, which needs the file handle.

Help says FileAttr will return the handle, but only in Win16:

 FileAttr(filenumber, returntype)

 filenumber     Required; Integer. Any valid file number.

 returntype     Required; Integer. Number indicating the type of information to
  return. Specify 1 to return a value indicating the file mode. On 16-bit
  systems only, specify 2 to retrieve an operating system file handle.
  ** Returntype 2 is not supported in 32-bit systems and causes an error. **

Thanks,
J. Bodie



Sun, 18 Nov 2001 03:00:00 GMT  
 How to get file handle of file opened by VB?
Generally speaking, the file API functions only work on files opened by the
CreateFile or OpenFile API functions.  Those two functions return the required
file handle.

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner



Quote:
>Is it possible to get the file handle of a file opened by VB under Win32?
> I'd like to use FlushFileBuffers, which needs the file handle.

>Help says FileAttr will return the handle, but only in Win16:

> FileAttr(filenumber, returntype)

> filenumber     Required; Integer. Any valid file number.

> returntype     Required; Integer. Number indicating the type of information to
>  return. Specify 1 to return a value indicating the file mode. On 16-bit
>  systems only, specify 2 to retrieve an operating system file handle.
>  ** Returntype 2 is not supported in 32-bit systems and causes an error. **

>Thanks,
>J. Bodie



Sun, 18 Nov 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting API file handle to open file

2. Getting open file name w/o opening file

3. VB5: convert VB file handle to OS file handle

4. File Open - doesn't handle multiple files!

5. Get file handle of Basic-Opened file

6. C File Handle and OS File Handle

7. OS file handle versus C file handle

8. Q: Convert file handle pointer to file number in VB

9. from VB file number to VC file handle

10. dynamically getting file name when saving DOC file in VB

11. Remove open handles to MDB-file

12. Opening a File Open window for file selection in VBA

 

 
Powered by phpBB® Forum Software