Discussion:
is wininet obsolete?
(too old to reply)
fir
2017-10-23 17:57:29 UTC
Permalink
i got winapi experience but im lacking
netwrk coding experience, except the very basic winsock2

some my friend tried to code some win32 program that connects to irc and works like irc bot,
she wanted especially to read is someone
pastes youtbe link to irc chanel and
translate it to this youtibe movie title
and send this name back to to chanel (typical irc bot)

i got no idea what is good way of relizing that

one option seems to me trying to do it with winsock but im not sure how hard or "unreliable" it would be as there is http
protocol you need to code a bit

other options seems to me there is somethiong called wininet but i dont exactly know whats that - would using it help in such task?

could someone talk somethink on that all?
R.Wieser
2017-10-23 19:46:39 UTC
Permalink
Fir,
Post by fir
one option seems to me trying to do it with winsock but im not sure
how hard or "unreliable" it would be as there is http protocol you need
to code a bit
IRC isn't the same as HTTP (far from it even). I don't think you can use
any of the HTTP related functions to communicate with IRC ... And for the
same reason I don't think that wininet.dll will work.

And on which version of the OS do you want to write/run it ? I'm asking,
as just now tried to take a peek at XPs winsock.dll, and I couldn't (its not
PE style).

Personally I always use ws2_32.dll on anything regarding sockets thats not
supported on a high level by MS (HTTP, FTP and a few others).

But, have you ever thought of grabbing an ActiveX component (like
mswinsck.ocx is one for HTTP), and than script the whole thing (VBScript
comes to mind). You see, there is a good chance someone has already
written such a component, and you would than only need to handle the
high-level stuff (read: handle strings).

Regards,
Rudy Wieser
fir
2017-10-24 15:08:23 UTC
Permalink
Post by R.Wieser
Fir,
Post by fir
one option seems to me trying to do it with winsock but im not sure
how hard or "unreliable" it would be as there is http protocol you need
to code a bit
IRC isn't the same as HTTP (far from it even). I don't think you can use
any of the HTTP related functions to communicate with IRC ... And for the
same reason I don't think that wininet.dll will work.
And on which version of the OS do you want to write/run it ? I'm asking,
as just now tried to take a peek at XPs winsock.dll, and I couldn't (its not
PE style).
Personally I always use ws2_32.dll on anything regarding sockets thats not
supported on a high level by MS (HTTP, FTP and a few others).
But, have you ever thought of grabbing an ActiveX component (like
mswinsck.ocx is one for HTTP), and than script the whole thing (VBScript
comes to mind). You see, there is a good chance someone has already
written such a component, and you would than only need to handle the
high-level stuff (read: handle strings).
Regards,
Rudy Wieser
i use winsock 2, dont know what dll it even is

my friend code bot for irc, communication with irc is done via winsock but she wants to code bot that read info fromm www pages (espacially youtube)

refer my questions, i asked more about wininet not winsock, and how to code such hhtp related things in winapi
R.Wieser
2017-10-24 17:05:43 UTC
Permalink
fir,
... but she wants to code bot that read info fromm www pages (espacially
youtube)
Ah, thatatway. I didn't directly get that part of it. My apologies.
refer my questions, i asked more about wininet not winsock, and how to
code such hhtp related things in winapi
In that case the InternetReadFile function within the WinInet DLL could be a
good starting point:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa385103(v=vs.85).aspx

There are several examples floating on the interwebs too, like here:

https://www.codeproject.com/Articles/6939/WWW-HTTP-HTTPS-FTP-Client-using-WININET

(check out the "Synchronized HTTP GET" example.

Or here:

https://stackoverflow.com/questions/4140529/internetreadfile-to-char-in-c

Is that what you where looking for ?

Regards,
Rudy Wieser
fir
2017-10-25 18:40:29 UTC
Permalink
Post by R.Wieser
fir,
... but she wants to code bot that read info fromm www pages (espacially
youtube)
Ah, thatatway. I didn't directly get that part of it. My apologies.
refer my questions, i asked more about wininet not winsock, and how to
code such hhtp related things in winapi
In that case the InternetReadFile function within the WinInet DLL could be a
https://msdn.microsoft.com/en-us/library/windows/desktop/aa385103(v=vs.85).aspx
https://www.codeproject.com/Articles/6939/WWW-HTTP-HTTPS-FTP-Client-using-WININET
(check out the "Synchronized HTTP GET" example.
https://stackoverflow.com/questions/4140529/internetreadfile-to-char-in-c
Is that what you where looking for ?
Regards,
Rudy Wieser
i dont know, i somewhere heard that wininet is obsolete, but im not sure
and i remember wrong

i got no experience to know what is a good way of doing such things in winapi

the options are at least 3
1) winsock2
2) wininet
3) something other?

right now i dont need to code it yet but
will need it after some time and it would be good to know
R.Wieser
2017-10-25 19:38:27 UTC
Permalink
Fir,
Post by fir
i somewhere heard that wininet is obsolete
I heard, when I still used DOS v5.0, that FCBs (File Control Blocks) where
obsolete. But whatdoyouknow, they still exist. :-)

In short: don't believe everything you hear (not even from the horses
mouth).
Post by fir
the options are at least 3
Not really. WinInet has got a number of rather high-level HTTP functions
the other ones do not offer. Though you *can* do what you want using other
DLLs (like the WS2_32.DLL I mentioned), those mostly offer just basic
internet connectivity -- meaning you would need to write the whole HTTP
functionality ontop of it.

My suggestion ? Use WinInet. Don't let MS get to you. There is way too
much functionality in there for them to just kill it.

Regards,
Rudy Wieser
fir
2017-10-26 16:16:57 UTC
Permalink
Post by R.Wieser
Fir,
Post by fir
i somewhere heard that wininet is obsolete
I heard, when I still used DOS v5.0, that FCBs (File Control Blocks) where
obsolete. But whatdoyouknow, they still exist. :-)
In short: don't believe everything you hear (not even from the horses
mouth).
Post by fir
the options are at least 3
Not really. WinInet has got a number of rather high-level HTTP functions
the other ones do not offer. Though you *can* do what you want using other
DLLs (like the WS2_32.DLL I mentioned), those mostly offer just basic
internet connectivity -- meaning you would need to write the whole HTTP
functionality ontop of it.
My suggestion ? Use WinInet. Don't let MS get to you. There is way too
much functionality in there for them to just kill it.
i dont say i belive it, but still i just
dont know

if wininet is ok will work everywhere and will spare me to coding most boring pieces that probably would be best news

this my friend mentioned decided to use external library curl but 9as i follow her and do quick what she do but in pure winapi) i will probably use wininet for this same purpose
R.Wieser
2017-10-26 16:32:44 UTC
Permalink
Fir,
i dont say i belive it, but still i just dont know
You seem to be falling for something called FUD (Fear, Uncertanty, Doubt).
Don't. When you do not shake it you won't be able to move forward. :-\

Lets face it, whats the *absolute worst* that can happen. That would be
that the next update removes that DLL. And that won't happen because the OS
needs it, and scores of other commercial software relies on it.

The next-worst think would be that the next OS version (Win11 ?) will not
have it anymore. But thats a problem for over a couple of years or so, and
than you will also know what its than replaced with.

So, stop worrying and start coding! :-)

Regards,
Rudy Wieser
fir
2017-10-27 16:59:51 UTC
Permalink
Post by R.Wieser
Fir,
i dont say i belive it, but still i just dont know
You seem to be falling for something called FUD (Fear, Uncertanty, Doubt).
Don't. When you do not shake it you won't be able to move forward. :-\
Lets face it, whats the *absolute worst* that can happen. That would be
that the next update removes that DLL. And that won't happen because the OS
needs it, and scores of other commercial software relies on it.
The next-worst think would be that the next OS version (Win11 ?) will not
have it anymore. But thats a problem for over a couple of years or so, and
than you will also know what its than replaced with.
So, stop worrying and start coding! :-)
Regards,
Rudy Wieser
its not quite about this fud (though partially)

its more about i got experience in winapi but i got no experience in winapi network coding and i just dont know whats best for this purpose

wininet seem most logical but i would prefer to know it a bit more (besides i not code it yet as i code other things, i will be coding it later, no hurry here)

right now i decided to read slight over whole map of winapi and get bigger sight

https://msdn.microsoft.com/en-us/library/windows/desktop/ff818516(v=vs.85).aspx


check btw i am using other parts of winapi and im not much more worry as they
partially marked as deprecated (as they are somewhat core of winapi and much things stay on it)

for example i use a lot of blitter from gdi (gdi is said to be deprecated) i would use it still hovever GDI was
and probably is scandalously slow
- if i would like to write text editor and render true type fonts hovever i would probaby still using just gdi

for sound output i also used winmm which is probably also said to be deprecated (im not sure) (i used WaveOut kind of staff, not much of it hovever it worked)

this is all becouse my primary app target of choice is "windows xp 32 bit and above" and also i like old core components, this means i dont fear of deprecation but i just want to know what is just technically best

regards
ElChino
2017-11-22 19:27:04 UTC
Permalink
Post by fir
its more about i got experience in winapi but i got no experience
in winapi network coding and i just dont know whats best for this purpose
have you considered libcurl?
No support for IRC, but assuming IRC is a ping-pong type
protocol (more like POP3), it would be easy to use libcurl
for that. Refs:
https://curl.haxx.se/
https://github.com/curl/curl

R.Wieser
2017-10-24 08:15:18 UTC
Permalink
Fir,

I just took a closer look at the "winsock.dll" as available in XP. It
turns out its a 16-bit DLL (NE style, rather old), so I think that I can
rather confidentily state that its obsolete. Also, it does not seem to have
much, if any code content -- meaning its probably a stub, pointing thru to
another DLL to do the work

As for its contents ? Most, if not all of its contained function names are
also to be found in the WS2_32.DLL I mentioned.

Regards,
Rudy Wieser
Loading...