Article View: borland.public.cppbuilder.nativeapi
Article #7463Re: Passing a Variable to CopyFile
From: Colin B Maharaj
Date: Tue, 01 Feb 2005 02:38
Date: Tue, 01 Feb 2005 02:38
37 lines
2263 bytes
2263 bytes
If I am not mistaken, you need a double null for this type of operation?? Example... > char *NewFrom = "C:\\Backup\\Data\\*.zip\0\0"; > char *NewTo = "E:\\\0\0"; Pat wrote: > Hello I am trying to write an App in which the user can pass a Variable from > a DriveComboBox to copy a file from a specific location. Getting the > copyfile setup is easy enough but I can't seem to get the variable inserted. > The destination will (usually) be the root so at this point I don't need to > worry about assigning a folder etc. > > The error message I get is "Cannot convert 'AnsiString' to 'char *'" or > something to that effect depending on whether I try AnsiSting drive or char > drive. > > Thanks for any help can send my way. > > > } > char drive; //I've also tried AnsiString with errors > drive = DriveCombo->Drive; > > char *From = "C:\\Backup\\Data\\*.zip\0"; > char *To = "E:\\\0"; // <-Need to be able to define the drive here > SHFILEOPSTRUCT op; > ZeroMemory(&op, sizeof(op)); > //op.hwnd = Handle; > op.wFunc = FO_COPY; > op.pFrom = From; > op.pTo = To; > op.fFlags = FOF_NOCONFIRMATION; > SHFileOperation( &op); > > } > >
Technical Details
Message-ID:
<41feeb7e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41fe59c2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c07811462fe8d980 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 31 Jan 2005 22:38:02 -0400 From: Colin B Maharaj <noreply@myhost.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a4) Gecko/20040927 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Passing a Variable to CopyFile References: <41fe59c2$1@newsgroups.borland.com> In-Reply-To: <41fe59c2$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 200.108.11.128 Message-ID: <41feeb7e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1107225470 200.108.11.128 (31 Jan 2005 18:37:50 -0800) Lines: 37 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail