News:

Download Pelles C here: http://www.pellesc.se

Main Menu

New Year, new URL

Started by Pelle, January 10, 2026, 09:18:21 PM

Previous topic - Next topic

Robert

Quote from: Pelle on January 11, 2026, 11:02:49 PM
Quote from: alderman2 on January 11, 2026, 09:51:45 PMI don't think they're the ones you should lean on, but rather those who still program the basic language C.
Sure. The question is what this means in practice.

C on Windows in 2026+ will mainly be hobbyists (certainly for this project), where the latest and greatest isn't that important.
At my first real programming job in ~1985 I could have gone the Unix route (probably), but it wasn't much of an option back then... and 40+ years later it's still not an option...
After Windows and Unix there are roughly zero desktop operating-systems to choose from...

Microsoft have managed to mess up Windows quite a bit in recent years, focusing on irrelevant things (for enough people to matter), so it's not an obvious choice - except there are few other options. Now that I'm almost finished with ARM64 (still a potential flop), it's not clear what I should do. Write more examples? Not that exiting to be honest...

I'm not an innovator, and right now I can't find much inspiration anywhere...

Hi Pelle:

Thank you for your continuing amazing work !

Bored ? Nothing to do ? SWAR and AVX512 may offer some entertainment.

Check out Wojciech Muła's work. A good place to start is

http://0x80.pl/notesen/2016-09-17-avx512-foundation-base64.html

Lots of code at GitHub at

https://github.com/WojciechMula

Collection of Toys at

https://github.com/WojciechMula/toys

Thanks again for providing all of us tinkers with your tool for toys.

bitcoin

Hello, Pelle
How about creating some kind of library to simplify GUI application development? It's no secret that things are pretty bad in this area on Windows right now. C++ Builder was ideal, but it either died or became too complex. Qt is a heavy monster, and it's for C++ anyway. There's really nothing else. What if we made something like that for C?

TimoVJL

#17
Multitarget project file would be nice feature  ;)

EDIT: 2026-02-04
A project file, that support Release and debug output folders could be useful.
User could have both version for testing.
Now have to create another project file for independent debug version and have to have a workspace for them to keep them together.
May the source be with you

Pelle

Quote from: alderman2 on January 12, 2026, 06:05:10 PMWhy not create a new programming language?
No, I think for me "Pelles C" will just be "C".

Quote from: Robert on January 13, 2026, 09:11:31 PMBored ? Nothing to do ? SWAR and AVX512 may offer some entertainment.
Well, I added AVX-512F... a lot of work, but not much interest. Intel seemed to care most. Not sure where they will be in a few years.
Adding AVX-512<letter soup> is just more work. Nothing really new to learn.

Quote from: Robert on January 13, 2026, 09:11:31 PMCheck out Wojciech Muła's work.
I will do that.

Quote from: bitcoin on January 14, 2026, 05:28:04 PMHow about creating some kind of library to simplify GUI application development? It's no secret that things are pretty bad in this area on Windows right now. C++ Builder was ideal, but it either died or became too complex. Qt is a heavy monster, and it's for C++ anyway. There's really nothing else. What if we made something like that for C?
Well... it was one idea ~20 years ago, but it didn't happen then.
A quick solution would be a very basic library with narrow focus. Unless you happen to fit into this narrow focus it won't be of much help. A better solution would take more work, starting with a well researched specification. By the time this is done, perhaps the world has moved on...?

Quote from: TimoVJL on January 14, 2026, 09:33:45 PMMultitarget project file would be nice feature  ;)
I very much prefer to have one target per project. I think the concept of workspaces is good enough. Maybe not perfect, but good enough...
/Pelle

alderman2

I have created a library for Windows-specific functions etc. I have about 800 such functions. This is what it looks like to open a window and place it in the center:

hwnd=ac_WindowCreate_1(hInst,"Xxxx",100,100,1200,720,"MIN_MAX_CLO"); //
ac_WindowSetCenterPos_1(hwnd);


A push buttons:
hwnd_G_Knapp_1   =ac_ButtonSimpleCreate_1(hwnd,   0,0,120,30,"Name 1","C","SHADOW",BUTT-1);
hwnd_G_Knapp_2   =ac_ButtonSimpleCreate_1(hwnd, 120,0,120,30,"Name 2","C","SHADOW",BUTT-2);
hwnd_G_Knapp_3   =ac_ButtonSimpleCreate_1(hwnd, 240,0,120,30,"Name 3","C","SHADOW",BUTT-3);
hwnd_G_Knapp_4   =ac_ButtonSimpleCreate_1(hwnd, 360,0,120,30,"Name 4","C","SHADOW",BUTT-4);
hwnd_G_Knapp_5   =ac_ButtonSimpleCreate_1(hwnd, 480,0,120,30,"Name 5","C","SHADOW",BUTT-5);
hwnd_G_Knapp_6   =ac_ButtonSimpleCreate_1(hwnd, 600,0,120,30,"Name 6","C","SHADOW",BUTT-6);
hwnd_G_Knapp_7   =ac_ButtonSimpleCreate_1(hwnd, 720,0,120,30,"Name 7","C","SHADOW",BUTT-7);
hwnd_G_Knapp_8   =ac_ButtonSimpleCreate_1(hwnd, 840,0,120,30,"Name 9","C","SHADOW",BUTT-8);

This is made by me for me. If someone else had created my library, I would probably still have built this because it suits me. That's why you should probably make libraries like this yourself, you get the most benefit from it that way.

TimoVJL

#20
A poide resource editor can be useful for designing GUI.
Just read res-file for dynamic controls to window.
As far I remember, there is couple examples of it.


Dialog code from res-file

EDIT: example code removed
May the source be with you

Pelle

Quote from: alderman2 on February 03, 2026, 11:24:40 PMIf someone else had created my library, I would probably still have built this because it suits me. That's why you should probably make libraries like this yourself, you get the most benefit from it that way.

I agree. Many people stay within the same "domain" when writing programs, so similar code sequences are bound to come up again. Rather than simply copy and pasting the existing code, thinking about how to place it in a reusable library is a useful thought process by itself. It may trigger new ideas...
/Pelle

Vortex

#22
Hi Timo,

I built your code as a 32-bit console application but it crashes on Windows 7 64-bit.

ResDlgConv3.exe Rsrc.res
CRT: unhandled exception (main) -- terminating
Code it... That's all...

Vortex

Hi Timo,

It looks like that here is the issue :

PWORD pMenu = pPtr;
        if (*(WORD*)pPtr) {    // Menu ?
 --------->  while (pPtr) pPtr++; <-------------- This line
            pPtr ++;    // past zero
        } else {
            pPtr ++;
        }
Code it... That's all...