Re: URLDownloadToFileW Error

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bruce Eitman \(eMVP\) (beitmannospam_at_NOSPAM_applieddata.NOSPAM_net)
Date: 10/05/04


Date: Mon, 4 Oct 2004 22:22:52 -0400

Arvind please take advantage of tools like a debugger. MessageBox is cool,
but not very productive for finding your problem. It only gives you a look
at progress, you need to look at the data. This can be done using watch in
the debugger.

Susan, the txt file that he is opening has a list of URLs so I think that
the slash is right. It is going from URL to local file. Why he would want
to reverse the string is beyond me. Whether anything else is right I don't
know.

-- 
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net
Applied Data Systems
 www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member
Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups?  Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
"Susan" <susan@pile_HATE_SPAM_DOT_com> wrote in message
news:uSQefEhqEHA.3700@TK2MSFTNGP15.phx.gbl...
> Are you telling me that '\' changes to '/' when you do the string reverse?
>
> Can you print this out to debug?
>
> You are onto something big here.  On my emulator, I get the following.
>
> Original String:        \Storage Card\filename.txt
> Reversed String:     txt.emanelif\draC egarotS\
>
> So, you are changing the internal representation of the characters, and
this
> is only happening for the backslash.
>
> Wow.
>
> "Arvind" <arvinds@erivasystems.com> wrote in message
> news:%23ADeR8gqEHA.3172@TK2MSFTNGP10.phx.gbl...
> > _wcsrev(filen);
> >  filen = wcstok( filen, seps );
> >  _wcsrev(filen);
> >
> > im using here..
> > for getting filename from the fullpath
> >
> >
> > --
> > "eRiva Systems" - Where Technology Meets Life, Every Minute.
> >
> > arvindr@erivasystems.com
> >
> > www.erivasystems.com
> >
> > "Susan" <susan@pile_HATE_SPAM_DOT_com> wrote in message
> > news:OHIveVgqEHA.896@TK2MSFTNGP12.phx.gbl...
> > > So, you are reversing the string.
> > >
> > > But I didn't see the command where you are reversing the actual
> character
> > > itself.  And I don't believe that command exists.  But, please, I
could
> be
> > > mistaken.
> > >
> > > "abc" -> "cba"    Notice that the letter "c" still opens on the right.
> The
> > > character itself hasn't been changed, just the order of the string.
> > >
> > > "Arvind" <arvinds@erivasystems.com> wrote in message
> > > news:e$BDYRgqEHA.1272@TK2MSFTNGP09.phx.gbl...
> > > > im reversing the string then using this "/"
> > > > :-)
> > > >
> > > >
> > > > BTW how to use
> > > > IBindStatusCallback::OnProgress
> > > >
> > > > and update progressbar in the same dialog??
> > > > any sample code or app for updating progressbar in
urldownloadtofile?
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > "eRiva Systems" - Where Technology Meets Life, Every Minute.
> > > >
> > > > arvindr@erivasystems.com
> > > >
> > > > www.erivasystems.com
> > > >
> > > > "Susan" <susan@pile_HATE_SPAM_DOT_com> wrote in message
> > > > news:uyZAqLgqEHA.556@TK2MSFTNGP11.phx.gbl...
> > > > > Off the top...
> > > > > TCHAR *pAn = TEXT("/");  //for parsing \ from fullpath
> > > > >
> > > > > If this is the real code, don't you want a backslash?
> > > > >
> > > > >
> > > > > "Arvind" <arvinds@erivasystems.com> wrote in message
> > > > > news:OuOXfDgqEHA.3744@TK2MSFTNGP10.phx.gbl...
> > > > > > Hello,
> > > > > >
> > > > > > Im getting error when i try to download multiple files using
> > > > > > URLDownloadToFile
> > > > > >
> > > > > > the followinga re the code sample which im using.
> > > > > >
> > > > > > any idea to make it work?
> > > > > >
> > > > > >
> > > > > >
> > > > > >  {
> > > > > >  FILE* file = _tfopen(_T("\\Storage Card\\downloadlist.txt"),
> > > _T("r"));
> > > > > >
> > > > > >  TCHAR tstr[100];
> > > > > >  TCHAR *pAn = TEXT("/");//for parsing \ from fullpath
> > > > > >  TCHAR *seps = pAn;
> > > > > >
> > > > > >
> > > > > >  TCHAR sl[100] = _T("\\");
> > > > > >  TCHAR sl1[100] = _T("\\");
> > > > > > ///////////////////////////////////
> > > > > >  //adding last 3
> > > > > >  TCHAR *pAnsi = TEXT(".wmv");
> > > > > >
> > > > > >     TCHAR *ext = pAnsi;
> > > > > >
> > > > > >
> > > > > >  TCHAR dPath[100] = _T("\\Storage Card\\");//pdpath;
> > > > > >
> > > > > >
> > > > > >  MessageBox(_T("To Download Files Connect PDA to Internet!"),
> > > _T("Click
> > > > > > Ok!"), MB_OK);
> > > > > >
> > > > > >     while(_fgetts(tstr, 100, file)!= NULL)
> > > > > >
> > > > > >      {
> > > > > >   MessageBox(tstr, _T("Click  Ok!"), MB_OK);
> > > > > >
> > > > > >    TCHAR temp[100];
> > > > > >     memset( temp, '0', 100 );
> > > > > >
> > > > > >    TCHAR *filen = NULL;
> > > > > >    wcscpy(temp,tstr);
> > > > > >    filen = temp;
> > > > > >
> > > > > >    int l = wcslen(filen);
> > > > > >    _wcsrev(filen);
> > > > > >       filen = wcstok( filen, seps );
> > > > > >    _wcsrev(filen);
> > > > > >     MessageBox(filen,_T("arvi1"), MB_OK);
> > > > > >    wcscat(sl1,dPath);
> > > > > >    wcscat(sl1,sl);
> > > > > >    wcscpy(dPath,sl1);
> > > > > >    wcscat(dPath,filen);
> > > > > >
> > > > > >    MessageBox(dPath,_T("Downloaded..."), MB_OK);
> > > > > >
> > > > > >   HRESULT hr;
> > > > > >
> > > > > >     hr =
> > > ::URLDownloadToFileW(NULL,(LPCTSTR)tstr,(LPTSTR)dPath,0,NULL);
> > > > > > //The following URLDownloadToFileW are working
> > > > > > //hr = ::URLDownloadToFileW(NULL,(LPCTSTR)tstr,_T("\\Storage
> > > > > > Card\\arvind.enc"),0,NULL);
> > > > > >
> > > > > >   wcscpy(dPath,_T("\\Storage Card\\"));
> > > > > >   wcscpy(sl,_T("\\"));
> > > > > >   wcscpy(sl1,_T("\\"));
> > > > > >      }
> > > > > >    fclose(file);
> > > > > >     MessageBox(_T("Complete!"),_T("Download..."), MB_OK);
> > > > > >   }
> > > > > >
> > > > > >
> > > > > > --
> > > > > > "eRiva Systems" - Where Technology Meets Life, Every Minute.
> > > > > >
> > > > > > arvindr@erivasystems.com
> > > > > >
> > > > > > www.erivasystems.com
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: maximum string length for MessageBox.Show()
    ... It appears that if the string is beyond the limit, ... method fails silently by not showing the messagebox at all. ... reproducable in the debugger and outside of it (inside the debugger, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: LED Shorted??
    ... where human factors and lack of reverse ... I've associated end of life or infant mortality of LEDs ... So you have the current through string and voltage across the string? ... at least I put one there so the inductor doesn't kill itself. ...
    (sci.electronics.design)
  • Re: Reverse words in a string (Another Interview question)
    ... >> I'm using a linked list to contain words that will be output in reverse ... A stack is exactly that. ... C's string handling sucks. ... > void reverse_string(char * ostr) ...
    (comp.programming)
  • Re: question about catching TCLs output
    ... We have a debugger which is made of TCL and C languge, ... integrate has nothing to do with Eclipse, they(our IDE group members) use ... input and get its output to the display(I think this is standard output). ... BUT the result string built up with "Tcl_AppendElement" can't be caught. ...
    (comp.lang.tcl)
  • Re: LED Shorted??
    ... where human factors and lack of reverse ... I've associated end of life or infant mortality of LEDs ... So you have the current through string and voltage across the string? ...
    (sci.electronics.design)