Re: CopyFile in windows CE by seshu
seshu
Tue Jun 17 23:53:14 PDT 2008
On Jun 17, 9:16 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT
no instrument no spam DOT com> wrote:
> You understand that he's telling you that your code is wrong. You will get
> error 2 if you specify a source file that can't possibly exist because your
> text is not Unicode. Fix the problems indicated by Michael and then show us
> what you have and tell us what you see. CopyFile() *DOES* work. Your code
> is bad.
>
> Paul T.
>
> "seshu" <seshucheruk...@gmail.com> wrote in message
>
> news:0c47d1d0-e05d-41ed-9ba1-e059a066ca2d@d45g2000hsc.googlegroups.com...
> On Jun 17, 3:47 pm, "Michael Salamone" <mikesa#at#entrek#dot#com>
> wrote:
>
>
>
> > You have at least one type below. You have to pass wide string to most
> > WinCE functions including CopyFile. I assume you got that, though - and it
> > really is just a typo. Otherwise it would have failed to compile.
>
> > Do you have another typo? Use \\ for path / filename separator. The way
> > you have it, you put a tab character in the directory name (\t is tab).
> > But
> > if you had that error, I imagine your error checking (detecting that
> > CopyFile failed and then calling GetLastError() to get extended error
> > information) would have clued you into that.
>
> > And certainly the source file exists.
>
> > And certainly there is enough storage available in \Windows to accomodate
> > the file.
>
> > So since the above potential problems have been ruled out, I must assume
> > the
> > call to CopyFile is actually succeeding. Are you resetting the device it's
> > after the reset that the file doesn't exist? Perhaps the \Windows
> > directory
> > is in RAM and thus not persisted across system reset.
>
> > --
> > Michael Salamone, eMVP
> > Entrek Software, Inc.www.entrek.com
>
> > "seshu" <seshucheruk...@gmail.com> wrote in message
>
> >news:074a186b-fc15-4f01-8da5-64efcefa920d@d45g2000hsc.googlegroups.com...
>
> > > Hello,
>
> > > Here i want to use CopyFile to copy a file from Storage Card and keep
> > > in Windows directory.
>
> > > I used the following code in my driver, after SD Card driver loaded
> > > successfully
> > > CopyFile("\\Storage Card\text.txt", "\\Windows\text.txt, TRUE);
>
> > > But i have not seen any file like text.txt in my windows directory.
>
> > > Could you please let me know where i m doing wrong.
> > > Or whether the CopyFile will work in my driver or not.
>
> > > Thanks in advance,
> > > Seshu- Hide quoted text -
>
> > - Show quoted text -
>
> Hi,
> I tried to do the changes, no luck.
>
> I tried to output the getlasterror it is 2, file cannot be found.
> so, then i tried copy windows directory file to another directory.'
> here also i cannot able to success.'
>
> how can we make sure whether copyfile works fine with driver code.
>
> Thanks,
> Seshu
Hi Michael and Paul,
I can able to successfully copy the file from SD card and placed in
windows directory.
the difference is as said by Michael i have to use wide string in
WinCE functions.
Thank you very much for your help.
Seshukumar.