Article View: borland.public.cppbuilder.nativeapi
Article #8214Re: How to download a file WITHOUT using the FTP..only through HTTP..
From: Ed Mulroy [TeamB]
Date: Tue, 16 Nov 2004 05:28
Date: Tue, 16 Nov 2004 05:28
78 lines
3203 bytes
3203 bytes
It is late and (1:20 AM here right now) and I am tired
so consider the source. I don't think the ampersand in
the line below is ok. I think it is a mistake.
> SessionHandle session_handle;
>
> if(&session_handle) // <-----is this OK...?
The class SessionHandle has an overloaded bool operator
which returns true if it is properly initialized. The
lines I used are below and call that overloaded operator.
----------
SessionHandle session_handle;
if (session_handle)
----------
>my next step is now to throw away this WinInet.lib
>and replace it with dynamicly callingns to
>LoadLibrary() and GetProcAddress()
Do you mean like this?
http://www.mulroy.org/try.zip
Give the command
make -f try.mak
(where the space after the -f and the
".mak" extension are optional)
>i need to make this programm 100 % standalone
>thats why i can't use the .lib...
You CANNOT make the program "100% standalone". It will
always require at least kernel32.dll and user32.dll because
it is a Windows programs and those DLL's are where Windows
resides. By explicitly linking to wininet.dll you remove
the implicit requirement for the DLL that the import library
causes so it can load on a system where that DLL is missing
but it's not going to run correctly if the DLL cannot be
found.
. Ed
"Oren Halvani" <Spam@Me-Please.com> wrote:
>"Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> schrieb im
> Newsbeitrag news:41990c0f$1@newsgroups.borland.com...
>
>Ed, THANS alot for the fantastic snip..
>
>i need a windows-interface so i've modified your
>code a little and it works really SUPERB !!
>
>can you take a last look on it if i've modified something
>wrong / dangerous...?
>
>i'm thinking here i.e.:
>
>// ReadFileViaHTTP(const string& src_url,const string& dest_name)
>{
> DWORD result = 0;
> SessionHandle session_handle;
>
> if(&session_handle) // <-----is this OK...?
>
>
>my next step is now to throw away this WinInet.lib and
>replace it with dynamicly callingns to LoadLibrary() and
>GetProcAddress()
>
>i need to make this programm 100 % standalone thats why
>i can't use the .lib...
>
>
>once again thanks for your great help ED :-)
Technical Details
Message-ID:
<41999e15$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41984e1e@newsgroups.borland.com> <41990c0f$1@newsgroups.borland.com> <41992dc8@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f57c5862d590fb6d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Sender: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Reply-To: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Subject: Re: How to download a file WITHOUT using the FTP..only through HTTP.. Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 24.74.175.102 References: <41984e1e@newsgroups.borland.com> <41990c0f$1@newsgroups.borland.com> <41992dc8@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <41999e15$1@newsgroups.borland.com> Date: 15 Nov 2004 22:28:37 -0700 X-Trace: newsgroups.borland.com 1100586517 207.105.83.66 (15 Nov 2004 22:28:37 -0700) Lines: 79 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail