src/taesooLib/BaseLib/utility/FileEx.cpp
BOOL CFileEx::Open( LPCTSTR lpFile, DWORD dwCreateDisp, DWORD dwAccess, DWORD dwShare, LPSECURITY_ATTRIBUTES lpSec )
{
	if( IsOpen() ) {
		Close();
	}

	if( ( lpFile == NULL ) || ( lstrlen( lpFile ) > _MAX_PATH ) ) {
		return FALSE;
	}

//	m_hFile = ::CreateFile( lpFile, dwAccess, dwShare, lpSec, dwCreateDisp, FILE_FLAG_OVERLAPPED, NULL );
	m_hFile = ::CreateFile(lpFile, dwAccess, dwShare, lpSec, dwCreateDisp, 0, NULL );
			
	if( m_hFile == INVALID_HANDLE_VALUE ) {
			// file open failed.  Throw error back to the user with the
			// windows error code.
		ThrowErr( ::GetLastError(), FALSE );
		m_hFile = NULL;		
	}else{
		::_tcscpy( m_lpFile, lpFile );
		m_bOpen = TRUE;
	}

	return m_bOpen;
}
///////////////////////////////////////////////////////////////////////////////
//	Desc:
//		Opens a standard win32 file using the same type of parameters as
//		the CreateFile API however, the template file is assumed to be null
//		and the flags are locked ( not selectable by user ) because me MUST
//		ensure the FILE_FLAG_OVERLAPPED flag is properly set.
///////////////////////////////////////////////////////////////////////////////
Opens a standard win32 file using the same type of parameters as
the CreateFile API however, the template file is assumed to be null
and the flags are locked ( not selectable by user ) because me MUST
ensure the FILE_FLAG_OVERLAPPED flag is properly set.
Opens a standard win32 file using the same type of parameters as the CreateFile API however the template file is assumed to be null and the flags are locked ( not selectable by user ) because me MUST ensure the FILE_FLAG_OVERLAPPED flag is properly set .
BOOL CFileEx::Open( LPCTSTR lpFile, DWORD dwCreateDisp, DWORD dwAccess, DWORD dwShare, LPSECURITY_ATTRIBUTES lpSec )
{
	if( IsOpen() ) {
		Close();
	}
	if( ( lpFile == NULL ) || ( lstrlen( lpFile ) > _MAX_PATH ) ) {
		return FALSE;
	}
	m_hFile = ::CreateFile(lpFile, dwAccess, dwShare, lpSec, dwCreateDisp, 0, NULL );
	if( m_hFile == INVALID_HANDLE_VALUE ) {
		ThrowErr( ::GetLastError(), FALSE );
		m_hFile = NULL;		
	}else{
		::_tcscpy( m_lpFile, lpFile );
		m_bOpen = TRUE;
	}
	return m_bOpen;
}
BOOL CFileEx :: Open ( LPCTSTR lpFile , DWORD dwCreateDisp , DWORD dwAccess , DWORD dwShare , LPSECURITY_ATTRIBUTES lpSec ) { if ( IsOpen ( ) ) { Close ( ) ; } if ( ( lpFile == NULL ) || ( lstrlen ( lpFile ) > _MAX_PATH ) ) { return FALSE ; } m_hFile = :: CreateFile ( lpFile , dwAccess , dwShare , lpSec , dwCreateDisp , 0 , NULL ) ; if ( m_hFile == INVALID_HANDLE_VALUE ) { ThrowErr ( :: GetLastError ( ) , FALSE ) ; m_hFile = NULL ; } else { :: _tcscpy ( m_lpFile , lpFile ) ; m_bOpen = TRUE ; } return m_bOpen ; }
Desc:
Opens a standard win32 file using the same type of parameters as
the CreateFile API however, the template file is assumed to be null
and the flags are locked ( not selectable by user ) because me MUST
ensure the FILE_FLAG_OVERLAPPED flag is properly set.
Desc : Opens a standard win32 file using the same type of parameters as the CreateFile API however the template file is assumed to be null and the flags are locked ( not selectable by user ) because me MUST ensure the FILE_FLAG_OVERLAPPED flag is properly set .
//	m_hFile = ::CreateFile( lpFile, dwAccess, dwShare, lpSec, dwCreateDisp, FILE_FLAG_OVERLAPPED, NULL ); // file open failed.  Throw error back to the user with the // windows error code.