Article View: borland.public.cppbuilder.nativeapi
Article #17298Problem in deleting file!
From: Safari
Date: Fri, 28 Mar 2003 08:34
Date: Fri, 28 Mar 2003 08:34
25 lines
1565 bytes
1565 bytes
Hello to all,
I have problem, I can't delete files! Please help me.
bool __fastcall RemoveFile(char *hPath)
{
SHFILEOPSTRUCT hFile;
ZeroMemory(&hFile, sizeof(hFile));
hFile.hwnd = 0;
hFile.wFunc = FO_DELETE;
hFile.pFrom = hPath;
hFile.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI;
return SHFileOperation(&hFile);
}
void __fastcall TMain::BitBtn4Click(TObject *Sender)
{
for (int a = ListView->Items->Count - 1; a >= 0; a--)
{
RemoveFile((ListView->Items->Item[a]->Caption).c_str());
ListView->Items->Item[a]->Delete();
}
}
Thanks,
Safari.
Technical Details
Message-ID:
<3E8408FF.5040308@alloymail.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5fde27ba165b16db,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-28 00:41:18 PST Message-ID: <3E8408FF.5040308@alloymail.com> Date: Fri, 28 Mar 2003 13:04:07 +0430 From: Safari <Safari@alloymail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Problem in deleting file! Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.28.33.94 X-Trace: newsgroups.borland.com 1048840728 81.28.33.94 (28 Mar 2003 00:38:48 -0800) Lines: 26 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail