LB Booster
« Windows Constants »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:54am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Windows Constants  (Read 166 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Windows Constants
« Thread started on: Nov 15th, 2016, 05:06am »

LB 4 and LBB differ in respect of the Windows Constants that are accepted (not least because I am not aware of there being a definitive list of which constants LB 4 accepts). My hope is that the LBB set of constants is a superset of the LB 4 one, but of course I don't know that for sure - if you ever discover a Windows Constant that LB 4 knows about but LBB doesn't please let me know.

Although the set of constants differs between LB 4 and LBB one would hope that the values don't, but in fact in one (hopefully unique) case that currently isn't true: _INVALID_HANDLE_VALUE is -1 in LBB and 4294967295 in LB 4! This accidental difference comes about because -1 is the official value of the constant in Microsoft documentation, but conventionally in Liberty BASIC handles are unsigned (ulong).

In the interests of compatibility I plan to change the value of _INVALID_HANDLE_VALUE in the next release of LBB, although of course that could conceivably result in an existing program (written solely for LBB) failing if it declares a handle as long rather than ulong. I will have to hope that isn't the case.

It raises the interesting question of why handles are conventionally assumed to be unsigned in Liberty BASIC, especially when you consider that in Windows they are signed:

Code:
#typedef HANDLE int 

If anybody knows I would be interested.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls