Restored from previous forum. Originally posted by darryl_bartlett.
Hi guys,
Just a really quick question for you. I was looking around some Visual Basic API examples and I came across some constants for it, namely:
CDS_UPDATEREGISTRY = &H1
CDS_TEST = &H2
DM_BITSPERPEL = &H40000
DM_PELSWIDTH = &H80000
DM_PELSHEIGHT = &H100000
Obviously, PureBasic doesn't like the &Hxxxxx bit. How would I convert these numbers into a form which PureBasic would accept?
Thanks in advance.
Regards,
Darryl.
Converting API Constants to PureBasic
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
Don't forget that when converting Visual Basic apps to PureBasic, you don't
normally need to declare constants. For example, you can usually just throw
a hash (#) in front of the constant like so:
Visual Basic:
Public Const GW_CHILD=&H2
r=GetWindow_(GetDesktopWindow_(),GW_CHILD)
PureBasic:
; No need to declare API constants in PureBasic!
r=GetWindow_(GetDesktopWindow_(),#GW_CHILD)
As you can see, this is one of PureBasic's major advantages over Visual Basic.
Therefore, Darryl, you can most likely just use the following in your example,
without having to declare any constants in your PureBasic code:
#CDS_UPDATEREGISTRY, #CDS_TEST, #DM_BITSPERPEL, #DM_PELSWIDTH, #DM_PELSHEIGHT
PB - Registered PureBasic Coder
Edited by - PB on 15 February 2002 10:58:16
Don't forget that when converting Visual Basic apps to PureBasic, you don't
normally need to declare constants. For example, you can usually just throw
a hash (#) in front of the constant like so:
Visual Basic:
Public Const GW_CHILD=&H2
r=GetWindow_(GetDesktopWindow_(),GW_CHILD)
PureBasic:
; No need to declare API constants in PureBasic!
r=GetWindow_(GetDesktopWindow_(),#GW_CHILD)
As you can see, this is one of PureBasic's major advantages over Visual Basic.
Therefore, Darryl, you can most likely just use the following in your example,
without having to declare any constants in your PureBasic code:
#CDS_UPDATEREGISTRY, #CDS_TEST, #DM_BITSPERPEL, #DM_PELSWIDTH, #DM_PELSHEIGHT
PB - Registered PureBasic Coder
Edited by - PB on 15 February 2002 10:58:16
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm