用VC如何删除.dll文件

来源:百度知道 编辑:UC知道 时间:2024/05/30 22:43:22
请问用VC如何删除.dll或其它文件

char dStr[100];//下面这段用来删除当前目录下的a.dll
GetCurrentDirectory(100,dStr);
CString cStr;
cStr.Format("%s%s",dStr,"\\a.dll");
DeleteFile(cStr);

如果删除指定目录下的a.dll
DeleteFile("C:\\Windows\\a.dll");

DeleteFile
The DeleteFile function deletes an existing file.

BOOL DeleteFile(
LPCTSTR lpFileName // file name
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that specifies the file to be deleted.
Windows NT/2000: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to nearly 32,000 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see File Name Conventions.

Windows 95/98: This string must not exceed MAX_PATH characters.

Return Values
If the function succeeds, the return value