001
23.08.2005, 11:24 Uhr
FloSoft
Medialer Over-Flow (Administrator)
|
seit wann ist die msdn gesperrt?
Zitat: |
The OpenFile function creates, opens, reopens, or deletes a file.
Note Only use this function with 16-bit versions of Windows. For newer applications, use the CreateFile function.
C++: |
HFILE OpenFile( LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle );
|
Parameters lpFileName [in] A pointer to a null-terminated string that names a file to be opened. The string must consist of characters from the Windows character set. The OpenFile function does not support Unicode file names or opening named pipes.
lpReOpenBuff [out] A pointer to the OFSTRUCT structure that receives information about a file when it is first opened. The structure can be used in subsequent calls to the OpenFile function to see an open file.
The OFSTRUCT structure contains a pathname string member with a length that is limited to OFS_MAXPATHNAME characters, which is currently 128 characters. Because of this, you cannot use the OpenFile function to open a file with a path length that exceeds 128 characters. The CreateFile function does not have a path length limitation.
uStyle [in] An action to take.
Return Values If the function succeeds, the return value specifies a file handle.
If the function fails, the return value is HFILE_ERROR. To get extended error information, call GetLastError.
Remarks If the lpFileName parameter specifies a file name and extension only, this function searches for a matching file in the following directories and the order shown:
The directory where an application is loaded. The current directory. The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit Windows system directory. There is not a function that retrieves the path of this directory, but it is searched.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
The lpFileName parameter cannot contain wildcard characters.
The OpenFile function does not support the OF_SEARCH flag that the 16-bit Windows OpenFile function supports. The OF_SEARCH flag directs the system to search for a matching file even when a file name includes a full path. Use the SearchPath function to search for a file.
A sharing violation occurs if an attempt is made to open a file or directory for deletion on a remote machine when the value of the uStyle parameter is the OF_DELETE access flag OR'ed with any other access flag, and the remote file or directory has not been opened with FILE_SHARE_DELETE share access. To avoid the sharing violation in this scenario, open the remote file or directory with OF_DELETE access only, or call DeleteFile without first opening the file or directory for deletion.
|
-- class God : public ChuckNorris { }; |