News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

#91
Windows API / Re: Using DLGTEMPLATEEX struct...
Last post by TimoVJL - March 29, 2025, 02:25:54 AM
DLGTEMPLATE(EX) have been always a dynamic struct, just a hint, how Windows OS read it.
Many languages have their own way to use it.
Those who bother to read an old books for Windows programming knows that.
#92
The Orphanage / Re: 128-bit integer arithmetic...
Last post by zedd151 - March 29, 2025, 01:42:41 AM
Quote from: jack on March 29, 2025, 01:37:12 AMhere's the whole enchilada if you want to try run it
Doh!  :undecided:   My bad...

I expected that there was a Windows executable in the attachment to test.  :biggrin:
I wanted to see how my i7 performed on this.
#93
The Orphanage / Re: 128-bit integer arithmetic...
Last post by jack - March 29, 2025, 01:37:12 AM
I managed to adapt Biterider's oword assembler multiply and divide routines to FreeBasic
an unexpected result in timing the high-level multiply vs the asm version, with gcc backend and with optimization level of -O3
multiply n times d 100000000 times in a loop
a sum of the product is kept and printed out
in order to prevent gcc from eliminating the loop
and thereby making the timing meaningless

assembler multiply
n = 340282366920938463447387429234553266722
d = 18446744073709551615
product = 45370982256125128475310893311622766046
sum of product = 113427455641665582386530236262442737152
elapsed time seconds  0.296251199994003

high-level multiply
n = 340282366920938463447387429234553266722
d = 18446744073709551615
product = 45370982256125128475310893311622766046
sum of product = 113427455641665582386530236262442737152
elapsed time seconds  0.0651214999961667
here's the whole enchilada if you want to try run it
the assembler routines are by Biterider
#94
Windows API / Re: Using DLGTEMPLATEEX struct...
Last post by zedd151 - March 29, 2025, 01:32:00 AM
Anyway what I have learned here, is that the DLGTEMPLATEEX structure is not a structure to be used per se, but only to be used as a guide when creating in memory dialogs. Meaning it is not an actual usable structure as-is.

Seems that 'in memory' dialog boxes are not the way to go, in some instances. Especially if numerous controls will be added to it.

I used to use a registered window for most of my projects (going back several years), but have been looking to use dialog boxes more often lately.

Seems that using a resource based dialog box might be the best option. If numerous controls are needed however, maybe a registered window is the best way to go. Especially true if many controls are needed, and the controls need to be perfectly byte (pixel) aligned.

 :smiley:
I have scratched the idea of writing the three versions of a test program as mentioned above. I would rather concentrate on finishing the project already started. It is almost ready. And I am no longer considering using in memory dialog boxes at this point. And certainly not going to mess with DLGTEMPLATEEX any further.

#95
Windows API / Re: Using DLGTEMPLATEEX struct...
Last post by zedd151 - March 29, 2025, 01:01:43 AM
Quote from: jj2007 on March 29, 2025, 12:58:35 AM;-)
Ha ha. How much code do your macros expand to?  :toothy:
#96
Windows API / Re: Using DLGTEMPLATEEX struct...
Last post by jj2007 - March 29, 2025, 12:58:35 AM
;-)
#97
Windows API / Re: Using DLGTEMPLATEEX struct...
Last post by zedd151 - March 29, 2025, 12:18:55 AM
Quote from: NoCforMe on March 28, 2025, 05:23:12 PMThat "dialog units" thing is a real killer, which makes it really hard to line things up unless you have something like a resource editor to do it visually.
I wouldn't be using dilaog units at all.  :eusa_naughty:  Even using a dialog box editor, at certain intervals there seems to be some rounding. Take a column of controls for example. Either buttons or edit boxes. They are all specified to have the same size and spacing (in dialog units).
But every few controls would be off by a pixel in vertical alignment. Been there and done that.
Repositioning/resizing the controls in code would negate using a dialog box in the first place, since a considerable amount of code would be needed to perfectly align the controls.

The dialog box size would be determined by the desired client area in pixel dimensions, as in my last few posted examples.

Any controls can then be added the usual way using CreateWindowEx (as if we were working with a 'window') with byte alignment not dialog unit alignment, if I am not mistaken.
But, I will not be using any controls at first, only a menu. This is for a specific project that I am working on, to both minimize the code, and not use any resources.

I have some of that done already in that I have replaced the bitmaps with a coded alternative.
Just working on the dilaog box at this point.

If the in memory dialog box will tend to be code heavy, I will probably revert to using a resource dialog... since the in memory dilaog box code would probably use as much code as creating and using a registered window, if not more due to having to manually align any controls used and the extra steps needed in converting ascii to unicorn, etc.
In that case a resource dialog might be the best alternative, code wise... especially if no controls are needed.

I will, when time permits, create 3 versions of a test program with several controls.
One using RegisterWindow and CreateWindowEx i.e., a normal window.
Another using a resource dilaog box.
Another using an in memory dialog box.

For the dialog boxes, will add code to perfectly align the controls.

The version using less code (and very few macros), and smallest executable file size overall will be the victor.

:biggrin:

As I have more yard work to finish, this may have to wait...
I could probably put off the yard chores til tomorrow.  I frequent do.  :tongue:
#98
The Orphanage / Re: My ChatGPT+Gemini coding E...
Last post by daydreamer - March 28, 2025, 07:21:39 PM
Quote from: guga on March 28, 2025, 11:31:44 AM
Quote from: NoCforMe on March 28, 2025, 11:22:09 AMI'm sorry; I just don't understand this at all. At all.
For chrissakes: you're a programmer, right?
Why would you abdicate that role and ask some stupid machine to write code for you?

Hey, in the future, who needs puny hue-mons anyhow? The machines will just write code for the new machines.

Tell me what I'm missing here ...

In what is related to programming, IA (Regardless which you use) is basically a faster way for hunt for bugs or to port from one language to another or if you want to develop some functions etc a bit more faster when u don´t have enough free time. None of them are to be used 100% in replacement of a normal work someone is doing. It´s just a additional programming tool, IMHO. (Good one, btw, but just this: another programming tool when used as such)
Not being a professional programmer that loses job, because of AI ,I don't be sad if AI takes over a human coders job,but indirectly if all professional coders become x % more productive ,might end up a %  coders get fired because the companies need less  # coders
Some hobby coders,might be skilled in c -> asm coding and coding something new is fun without using AI ,for them using AI takes away fun part of coding

Someone tried ms machine learning ,programming AI ?

Self driving car,I am most afraid of car get hacked by harmful code,that can harm humans physically ,by drive full speed into a concrete wall or in other way

#100
Windows API / Re: Using DLGTEMPLATEEX struct...
Last post by NoCforMe - March 28, 2025, 05:23:12 PM
That "dialog units" thing is a real killer, which makes it really hard to line things up unless you have something like a resource editor to do it visually. My memory-template dialog creator almost gets it right: things line up, but the actual size of the dialog always needs a little tweaking (I have a preview feature that shows me what the dialog will actually look like).