This might be a pretty basic question, but I've been searching and cannot find an explanation. I'm playing with API functions for dialog boxes in VBA and I want to declare constants for the Window Styles as defined here so I can try to use the CreateDialog API function: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx
Normally I see windows constants in VBA defined as long types with a value something like &H000 or something like that. But, I can't find the &H000 format value for these constants, I can only find the 0x00000000 format values.
For example, see the OpenFileName documentation here and scroll down to the flags. The constant expressions are listed with values in the format 0x00000000. However, if we look at the CommonDialog constants here, we can see the same constants listed with their values in the format &H000.
So I guess I have at least three questions:
What do the 0x0000000 values represent?
What do the &H000 values represent?
Is their a way to convert between them?
Because I tried declaring Public Const WS_BORDER as Long=0x00800000L and I get a syntax area after the "x" saying expected end of statement.
The
0x...Lformat is explained here for C++ (I believe it's the same in a few other languages). The0xsignifies that the number is hexadecimal, and theLsignifies that it should be interpreted by the compiler as aLong.The equivalent VBA syntax would be
&H...&Where&Hsignifies hexadecimal and&signifiesLong.So for example, your statement:
Should be: