Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XDS Win32 API samples?

47 views
Skip to first unread message

Brian Knoblauch

unread,
Jan 18, 2021, 1:58:38 PM1/18/21
to
I see in the XDS documentation that it states - "The SAMPLES\GENERIC subdirectory of your XDS installation contains a generic
GUI application, which you can use as a base for your own applications."

However, I cannot find a SAMPLES\GENERIC subdirectory in my install... Does anyone have that information? I'm generally familiar with Win32 API programming, but am hitting some XDS specific snags. I found the modula2.org win32 API examples, but those appear to target a different compiler as fundamental things like initializing the required API structures blows up in ways that I can't find workarounds for yet.

Thanks,
Brian

Paul Richards

unread,
Jan 18, 2021, 4:17:05 PM1/18/21
to Brian Knoblauch
Brian

I have a SAMPLES\GENERIC subfolder. Also a MODULA and WINDEMO subfolders
amongst others. The WINDEMO is described as an example of the WINDOWS
and PPOCESS modukes.

Don't know if that helps.

Paul

Brian Knoblauch

unread,
Jan 18, 2021, 4:28:36 PM1/18/21
to
Thank you, that is helpful. I definitely don't have any of those in my install. I saw you mentioned a Belgian website in another thread, so I googled and got a copy from a .be University site. That one *does* include SAMPLES\GENERIC. GENERIC is a very basic Windows app. Also includes Mand which is a more advanced graphical one that will be useful to me. (Currently of my main project on a tangent porting over some old Java apps). Notably though, it does not have the WINDEMO folder. It was listed as version 2.51, same as the one I already had. Apparently there are multiple different distributions. Interesting. I think I have enough to help me solve some of the puzzles I've been battling today! Thank you!

--Brian

Chris Burrows

unread,
Jan 18, 2021, 4:43:32 PM1/18/21
to
Also check the xds-2.60 folder on the Excelsior Github site. This includes the Generic and Mand examples as well.

https://github.com/excelsior-oss

WinDemoM in the Topspeed folder is the closest match there:

xds-2.60/misc/Samples/TopSpeed/

Chris

Brian Knoblauch

unread,
Jan 18, 2021, 7:01:34 PM1/18/21
to
On Monday, January 18, 2021 at 4:43:32 PM UTC-5, Chris Burrows wrote:
> Also check the xds-2.60 folder on the Excelsior Github site. This includes the Generic and Mand examples as well.
>
> https://github.com/excelsior-oss
>
> WinDemoM in the Topspeed folder is the closest match there:
>
> xds-2.60/misc/Samples/TopSpeed/

Oh, very nice. I'll have to clone that repo for sure, not just for the samples, but also to give 2.6.0 a try!

Thanks!

Brian Knoblauch

unread,
Jan 19, 2021, 6:37:58 AM1/19/21
to
After testing, I highly recommend the XDS 2.60 install from GitHub. Besides having the samples, it also has a combined Windows module. MUCH easier to just IMPORT from Windows that having to scan the DEF files to find the exact submodule (WinUser, WinGDI, etc) required.

Of some note, the compiler must have some changes too as my .exe (around 58k) increased by 200 bytes when recompiled (prior to additional changes).

--Brian

Edward De Jong

unread,
Jan 21, 2021, 2:28:07 AM1/21/21
to
I have extensive Win32 libraries, designed for the StonyBrook/ADW compiler.
It has a very complete implementation of the Quickdraw system from Apple, so basically it is 95% emulation of the Apple OS as of System 7.
It does bitmap scaling, and creates a drawing API like Apple used. Much nicer than GDI. But it would take you some time to learn it.

Brian Knoblauch

unread,
Jan 24, 2021, 2:50:45 PM1/24/21
to
So far I'm good with GDI, but your library sounds pretty cool. I had my own graphics library written all in assembly back in the DOS days. My first uses of the Win32 API were in assembly too, this doing it from Modula-2 is a new experience. Obviously the code is easier to read, but I've run into some surprising snags, things that are super easy in assembly, but have tripped me up trying to do in Modula-2!

Edward De Jong

unread,
Jan 25, 2021, 4:14:46 AM1/25/21
to
My libraries of course use plain Win GDI API functions, but wrap them in such a way as to present a virtual Macintosh Quickdraw system. The Win GDI functions for bitmaps are crap. They don't really support scaling and transparency that well. I used this layer to build the Discus CD label design program, which sold a lot of copies and fed my family for 15 years. It still runs on Windows, but Apple has killed off 32 bit apps in their latest OS.

It was tremendous proof of how fantastic Modula-2 is for delivering commercial products of high performance and reliability. I had less than 5 errors in the product, and hundreds of thousands of users. It was ready for customer input in less than a second, and the EXE was only a few MB, even though it was around 100k lines of code.

I did have to use 1% assembler as some things are very awkward in M2, particularly in bit twiddling, and of course accessing the REP MOVSB instruction is not really accessible from M2, and the Intel chip only has one fast copy method and that is to use that instruction. Bit shifts are also very awkward, esp. since you want to keep as much in registers as possible.

I was able to equalize the code between StonyBrook (ADW) and the P1 GMBH compiler for macintosh to achieve cross platform, with 80% of the code being identical between the platforms. There were some odd issues of non-standardization about compiler pragmas and conditional compilation that required scripting to convert the code from the master (macintosh) to the Windows side. The StonyBrook compiler was far faster and although its IDE is crude, the post mortem debugger is a fantastic trick. So few systems have a post mortem debugger, where you can recreate the situation in the code that caused a crash, even if it was on a customer machine.

I have tried to continue the style of M2 in my private research project which is now shipping (beads language at http://beadslang.com). I basically took M2, and used the indent significant style of Python, to create something that compares favorably with TypeScript in terms of generating good HTML/JS web apps. The Wirth philosophy of simplicity and rigor has almost died out, and i for one can't stand the hypercomplex coding environments that are so common today.

Rust is quickly becoming the systems programming language of choice today; but i don't think it is a simple and clean as M2.
0 new messages