⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oxuncstandardactor.h

📁 没事随便上传的实例``有用的话就好说``没用的话你也就看看`
💻 H
📖 第 1 页 / 共 2 页
字号:
	// --- Out : longUNC : The Long File Name of the specified UNC
	// --- Returns : The result code
	// --- Effect : Converst an 8.3-format name toa LFN

	virtual HRESULT GetLogicalDrives(CString& sDrives);	// delimiter '|'
	// --- In  : 
	// --- Out : sDrives : A string containg all the logical drives seperated by a 
	//				vertical line ('|') if successful, empty otherwise
	// --- Returns : The result code
	// --- Effect : Returns a list of logical drives

	virtual HRESULT GetTotalDiskSpace(COXUNC UNC, DWORDLONG& nTotalSpace);
	// --- In  : UNC : The UNC (root)
	// --- Out : nTotalSpace :  The total space on the disk or 0 otherwise
	// --- Returns : The result code
	// --- Effect : Retrieves to total size of a disk

	virtual HRESULT GetFreeDiskSpace(COXUNC UNC, DWORDLONG& nFreeSpace);
	// --- In  : UNC : The UNC (root)
	// --- Out : nFreeSpace :  The free space on the disk or 0 otherwise
	// --- Returns : The result code
	// --- Effect : Retrieves to free size of a disk

	virtual HRESULT GetDriveType(COXUNC UNC, UINT& nDriveType);
	// --- In  : UNC : The UNC (root)
	// --- Out : nDriveType : The type of drive if successful
	// --- Returns : The result code
	// --- Effect : Retrieves to type of drive.  Possible values in case of success are
	//				DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM, DRIVE_RAMDISK

	virtual HRESULT GetDiskInformation(COXUNC UNC, CString& sName, DWORD& nSerialNumber, 
		DWORD& nMaximumComponentLength, DWORD& nFileSystemFlags, CString& sFileSystemName);
	// --- In  : UNC : The UNC (root)
	// --- Out : sName : The (volume) name of the disk
	//			 nSerialNumber : The serial number of the disk
	//			 nMaximumComponentLength : The maximum length, in characters, of a filename 
	//				component supported by the specified file system
	//			 nFileSystemFlags : Any combination of the following
	//				FS_CASE_IS_PRESERVED : File system preserves the case of filenames
	//				FS_CASE_SENSITIVE : File system supports case-sensitive filenames
	//				FS_UNICODE_STORED_ON_DISK : The file system supports Unicode in filenames
	//				FS_PERSISTENT_ACLS : File system preserves and enforces ACLs. 
	//				FS_FILE_COMPRESSION	 : File system supports file-based compression.
	//				FS_VOL_IS_COMPRESSED : The specified volume is a compressed volume
 	//			 sFileSystemName : The name of the file system (e.g. "NTFS", "FAT" etc)
	// --- Returns : The result code
	// --- Effect : Retrieves information about a drive

	virtual HRESULT SetDiskName(COXUNC UNC, LPCTSTR pszDiskName);
	// --- In  : UNC : The UNC (root)
	//			 pszDiskName : The new name of the disk
	// --- Out : 
	// --- Returns : The result code
	// --- Effect : Gives the specified valome a new name

	virtual HRESULT GetAttributes(COXUNC UNC, DWORD& nAttributes);
	// --- In  : UNC : The UNC
	// --- Out : nAttributes : 
	// --- Returns : The result code
	// --- Effect : Retrieves the attributes of the specified directory or file
	//				(FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_NORMAL,
	//				FILE_ATTRIBUTE_OFFLINE, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_SYSTEM, 
	//				FILE_ATTRIBUTE_TEMPORARY, FILE_ATTRIBUTE_COMPRESSED, FILE_ATTRIBUTE_DIRECTORY)

	virtual HRESULT SetAttributes(COXUNC UNC, DWORD nAttributes);
	// --- In  : UNC : The UNC
	//			 nAttributes : The new attributes to set
	// --- Out : 
	// --- Returns : The result code
	// --- Effect : Sets the attributes of the specified directory or file
	//				(FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_NORMAL,
	//				FILE_ATTRIBUTE_OFFLINE, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_SYSTEM, 
	//				FILE_ATTRIBUTE_TEMPORARY)

	virtual HRESULT GetCompression(COXUNC UNC, USHORT& nCompressionState);
	// --- In  : UNC : The UNC
	// --- Out : nCompressionState : The compression state of the UNC if successful or
	//				0 otherwise
	// --- Returns : The result code
	// --- Effect : Retrieves the compression state of the specified directory or file
	//				Possible values are 
	//					COMPRESSION_FORMAT_NONE
	//					COMPRESSION_FORMAT_LZNT1

	virtual HRESULT SetCompression(COXUNC UNC, USHORT nCompressionState);
	// --- In  : UNC : The UNC
	//			 nCompressionState : The compression state of the UNC
	// --- Out : 
	// --- Returns : The result code
	// --- Effect : Sets the compression state of the specified directory or file
	//				Possible values are 
	//					COMPRESSION_FORMAT_NONE
	//					COMPRESSION_FORMAT_LZNT1

	virtual HRESULT GetTime(COXUNC UNC, CTime& creationTime, CTime& lastAccessTime, CTime& lastWriteTime);
	// --- In  : UNC : The UNC
	// --- Out : creationTime : The creation time
	//			 lastAccessTime : The last access time
	//			 lastWriteTime :  The last write time
	// --- Returns : The result code
	// --- Effect : Gets the file times

	virtual HRESULT SetTime(COXUNC UNC, CTime creationTime, CTime lastAccessTime, CTime lastWriteTime);
	// --- In  : UNC : The UNC
	//			 creationTime : The new creation time or 0 if not to set this time
	//			 lastAccessTime : The new last access time or 0 if not to set this time
	//			 lastWriteTime :  The new last write time or 0 if not to set this time
	// --- Out : 
	// --- Returns : The result code
	// --- Effect : Sets the new file times

	virtual HRESULT FindFirstFile(COXUNC UNC, HANDLE &hFindFile, WIN32_FIND_DATA &findFileData,
		BOOL bOnlyDirectories = FALSE);
	// --- In  : UNC : The UNC
	//			 bOnlyDirectories : Whether this function should only return directories
	//                              and not normal files (Note : this is only a hint parameter
	//                              and may be ignored by the file system)
	// --- Out : hFindFile : The handle to be use in the next iterations, 
	//						 or NULL (not INVALID_HANDLE_VALUE) when failed
	//			 findFileData : Data about the file found
	// --- Returns : The result code
	// --- Effect : Searches a directory for a file whose name matches the specified 
	//              filename. Normally this function examines subdirectory names as well 
	//				as filenames. 
	//              Even when only directories are requested the file system 
	//				may also return files as well as subdirectories


	virtual HRESULT FindNextFile(HANDLE hFindFile, WIN32_FIND_DATA &findFileData);
	// --- In  : hFindFile : A valid find handle
	// --- Out : findFileData : Data about the file found
	// --- Returns : The result code
	// --- Effect : Searches a directory for the next file whose name matches the specified 
	//              filename. This function examines subdirectory names as well 
	//				as filenames. 

	virtual HRESULT FindClose(HANDLE hFindFile);
	// --- In  : hFindFile : A valid find handle
	// --- Out : 
	// --- Returns : The result code
	// --- Effect : Closes the find handle to end the search
	//				 The handle cannot be used in subsequent calls to either 
	//				 the FindNextFile or FindClose function. 

#ifdef _DEBUG
	virtual void AssertValid() const;
	// --- In  :
	// --- Out : 
	// --- Returns :
	// --- Effect : AssertValid performs a validity check on this object 
	//				by checking its internal state. 
	//				In the Debug version of the library, AssertValid may assert and 
	//				thus terminate the program.
	
	virtual void Dump(CDumpContext& dc) const;
	// --- In  : dc : The diagnostic dump context for dumping, usually afxDump.
	// --- Out : 
	// --- Returns :
	// --- Effect : Dumps the contents of the object to a CDumpContext object. 
	//				It provides diagnostic services for yourself and 
	//				 other users of your class. 
	//				Note  The Dump function does not print a newline character
	//				 at the end of its output. 
#endif

	virtual ~COXUNCStandardActor();
	// --- In  :
	// --- Out : 
	// --- Returns :
	// --- Effect : Destructor of the object

protected:

#ifdef _DEBUG
	static CString GetResultMessage(HRESULT hResult);
#endif // _DEBUG
	BOOL GetDiskSpace(LPCTSTR pszRoot, DWORDLONG& nTotalSpace, DWORDLONG& nFreeSpace);
	BOOL TimeToFileTime(const CTime& time, LPFILETIME pFileTime);
	
private:
                   
};

#endif // __OXUNCSTANDARDACTOR_H__
// ==========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -