AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

AVIFileOpen

The AVIFileOpen function opens an AVI file and returns the address of a file interface used to access it. The AVIFile library maintains a count of the number of times a file is opened, but not the number of times it was released. Use the AVIFileRelease function to release the file and decrement the count.

VB4-32,5,6
Declare Function AVIFileOpen Lib "avifil32" Alias "AVIFileOpenA" (ppfile As Long, ByVal szFile As String, ByVal mode As Long, pclsidHandler As Any) As Long

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
Avifil32

Parameter Information
· ppfile
Address to contain the new file interface pointer.

· szFile
Null-terminated string containing the name of the file to open.

· mode
Access mode to use when opening the file. The default access mode is OF_READ. The following access modes can be specified with AVIFileOpen:
OF_CREATE
Creates a new file. If the file already exists, it is truncated to zero length.

OF_SHARE_DENY_NONE
Opens the file nonexclusively. Other processes can open the file with read or write access. AVIFileOpen fails if another process has opened the file in compatibility mode.

OF_SHARE_DENY_READ
Opens the file nonexclusively. Other processes can open the file with write access. AVIFileOpen fails if another process has opened the file in compatibility mode or has read access to it.

OF_SHARE_DENY_WRITE
Opens the file nonexclusively. Other processes can open the file with read access. AVIFileOpen fails if another process has opened the file in compatibility mode or has write access to it.

OF_SHARE_EXCLUSIVE
Opens the file and denies other processes any access to it. AVIFileOpen fails if any other process has opened the file.

OF_READ
Opens the file for reading.

OF_READWRITE
Opens the file for reading and writing.

OF_WRITE
Opens the file for writing.

· pclsidHandler
Address of a class identifier of the standard or custom handler you want to use. If the value is NULL, the system chooses a handler from the registry based on the file extension or the RIFF type specified in the file.

Return Values
Returns zero if successful or an error otherwise. Possible error values include the following:
AVIERR_BADFORMAT
The file couldn’t be read, indicating a corrupt file or an unrecognized format.
AVIERR_MEMORY
The file could not be opened because of insufficient memory.
AVIERR_FILEREAD
A disk error occurred while reading the file.
AVIERR_FILEOPEN
A disk error occurred while opening the file.
REGDB_E_CLASSNOTREG
According to the registry, the type of file specified in AVIFileOpen does not have a handler to process it.

Examples

Related Functions

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/