VOGONS


First post, by ericmackrodt

User metadata
Rank Newbie
Rank
Newbie

Hi everybody,

I want to write some software for Windows 3.1 for fun and I want this piece of software to be able to do http requests to a server I built in golang.
I managed to kinda get started using C with Microsoft Visual C++ and I managed to get this project to connect to my server and request stuff:
https://github.com/yeokm1/w31slack

But Windows development in C is tough, especially now that it's super hard to find information about the Windows api from the 16bit era.

I was thinking about playing around Visual Basic 3, but I can't find a way to do network requests from it.
Delphi 1 would be a great option, but I don't know if there are http components for it.

So, my question is, what are my options to write a program that can do requests to a server on Windows 3.1 that are not as overwhelming as C/C++?
Does anyone know about a way to do HTTP from Visual Basic 3 or Delphi 1?

Thanks in advance for the help!

Reply 1 of 6, by Ringding

User metadata
Rank Member
Rank
Member

The API documentation for Win16 is actually extremely easy to find – it’s all contained in win31wh.hlp. The problem is that this API does not include any socket functionality, as the networking stuff was usually provided by third parties. The winsock API is mostly the same as it is today, though, and the problem of talking to winsock is already solved in the repository you linked. It’s just that development for the 16 bit segmented memory model is really annoying, and not having a proper system console or shell only makes matters worse. As well as the fact that you can easily mess up your entire OS by running your unfinished programs for testing. So if you consider all of this fun, then it is very inconsequential to ask for shortcuts like Visual Basic or Delphi 😉.

Reply 2 of 6, by Jo22

User metadata
Rank l33t++
Rank
l33t++
ericmackrodt wrote on 2022-05-12, 12:18:

But Windows development in C is tough, especially now that it's super hard to find information about the Windows api from the 16bit era.

Say, when was the last time you visited a real, physical library? 🙂
No, really. I've found a Windows 1.x API book in my local library a few years ago.
It was an later issue with some additional notes on Windows 2.x API changes (new features).
If you're curious, have a look for "MS Windows" or "Windows Presentation Manager" or similar old-fashioned titles.
If you're lucky, the book has a 5,25" book diskette with an ancient WINDOWS.H file. ^^

ericmackrodt wrote on 2022-05-12, 12:18:

I was thinking about playing around Visual Basic 3, but I can't find a way to do network requests from it.

No idea, sorry. 😔 I used VB 1.0 mainly, at the time. A bit of VB 2.0, also.
Anyway, what you must look for are "VBX" libraries.
They're for 16-Bit Visual Basic. Also work on VB4, 16-Bit version.

ericmackrodt wrote on 2022-05-12, 12:18:

Delphi 1 would be a great option, but I don't know if there are http components for it.

Understandable. In my place, when Delphi 1.0 was released, our government still
was amazed of ISDN and the postal office's Videotex system (not Videotext). 🤣
"Internet? Huh?"
No seriously, at the time, say 94/95/96, they wondered how to improve that Videotex system, which eventually lead to the shortlived KIT system.

Anyway, you can look for OWL or VCL libraries.
https://en.wikipedia.org/wiki/Object_Windows_Library

OWL was a technology part of Turbo Pascal for Windows or Borland Pascal 7 for Windows.
Both were sort of predecessors of Delphi 1.x.
TPW can also compile Real-Mode compatible applications, for those Windows 3.0 fans.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 3 of 6, by keenmaster486

User metadata
Rank l33t
Rank
l33t

Dig around in Google with searches like "VBX TCP/IP" and "visual basic TCP"

Find those old websites that have downloads for VBX packages that will let you open TCP connections and send and receive data. Then you can start making simple GET and POST requests. You'll have to build up the HTTP requests manually.

I flermmed the plootash just like you asked.
World's foremost 486 enjoyer.

Reply 5 of 6, by doshea

User metadata
Rank Member
Rank
Member
ericmackrodt wrote on 2022-05-12, 12:18:

I was thinking about playing around Visual Basic 3, but I can't find a way to do network requests from it.

On more recent versions of Windows, it was possible to use Visual Basic to control Internet Explorer via its API (not just via SendKeys or something). I wonder if this is possible in Windows 3.x? Perhaps you might run into the problem that the versions of Internet Explorer that support Windows 3.x don't support modern HTTP standards; I'm sure they don't support TLS for example, I'm not sure what other problems they migh thave.

Does anyone know about a way to do HTTP from Visual Basic 3 or Delphi 1?

If you're open to other languages, I've seen old versions of Python for Windows 3.x, all of which required Win32s, and at least some of which according to my notes required winsock, so presumably they support socket communications. I can see that 1.4, 1.5.2 and 1.6.1 include httplib.py. From my notes, 1.4 required winsock, and I couldn't even get 1.6.1 to install presumably due to a missing dependency (but I was trying to install on a fairly clean install).

Ringding wrote on 2022-05-12, 14:18:

The API documentation for Win16 is actually extremely easy to find – it’s all contained in win31wh.hlp.

For the record this is the "Windows SDK" documentation. It was normally included with development tools in printed (since scanned by Bitsavers) format as well as WinHelp files (as named above) and could also be found on old MSDN CDs. But yes, I imagine that filename would be most helpful in tracking it down!

It’s just that development for the 16 bit segmented memory model is really annoying, and not having a proper system console or shell only makes matters worse.

Yes, those are definitely issues!

Does using Win32s make things a lot more pleasant since you don't need to deal with the segmented memory model, or does it make other things harder?

As for the lack of a console - meaning you can't do printf() and things like that, you have to instead make a GUI - many compilers included a library that gave you something a little bit like a DOS console:

Microsoft C/C++ 7.0, Visual C++ (1.x at least): QuickWin
Borland C++ 3-5: EasyWin
Borland Pascal 7 (not sure if Delphi has it): WinCrt
Watcom C/C++ 11: something about using the /bw option to wcl
Symantec C++, Digital Mars C++: WINC and/or WINIO (the latter was developed by Andrew Shulman and I think source code was in Microsoft Systems Journal)

Another option is Troy's Kernel (tkern) which doesn't give you such a powerful DOS-like console (you can't move the cursor around the screen) but it is like a little cut-down Cygwin in that you get a shell that you can run other tkern programs from.

I don't know how many of those are compatible with Win32s.

Reply 6 of 6, by doshea

User metadata
Rank Member
Rank
Member

Actually Watcom's DOS-on-Windows /bw option still exists in OpenWatcom, and I remembered that those compilers also have their own 32-bit extender like a DOS extender but for Windows 3.x - which they call win386 - so that as I understand it you don't need to install Win32s to avoid segmentation. This article on Fun with virtualization talks about win386 some more, and this is the Open Watcom 2.0 documentation example of a 32-bit non-GUI Windows 3.x application (it looks really trivial except for the timing loop bug the first article I linked to says you need to patch, if that is still present in newer versions).