Page 1 of 1

What's the story with 64-bit?

Posted: Fri Jan 02, 2009 3:09 pm
by PB
I'm a poor programmer in that I don't own Vista or a 64-bit PC. So, whenever
I see a post with a comment like "you should use always integer for handles"
it concerns me. Currently all my apps store handles in the default type, which
is (or was?) a long. That is, I code it like this: handle=OpenProcess_(). Does
that mean I should now be doing this: handle.i=OpenProcess_() :?:

Or, to put it another way: if I don't change my style, my apps will still run just
fine on 64-bit version of Windows, right? What's the story?

Posted: Fri Jan 02, 2009 3:20 pm
by freak
The default type with 4.30 (and therefore PB 64bit) is the integer type, so "handle=OpenProcess_()" will work just fine.

You only need to watch out in places where you added the type (structures for example).
Things like handles, #PB_Any values, PB thread, process, mutex values require the integer type.

All in all it is surprisingly easy to port a program to 64bit.
If you plan to port your stuff to 64bit some day, its not a bad idea to start using .i where you think it may be needed even now. Its less work to do in the future.

Posted: Fri Jan 02, 2009 8:51 pm
by SFSxOI
but a handle.l (long) won't work in 64 bit? Is that what your saying?

Posted: Fri Jan 02, 2009 8:56 pm
by Fred
That's it. Our advice is to omit the type (unless it's really necessary), so it will stick with the integer one and will save you some headache

Posted: Fri Jan 02, 2009 9:14 pm
by SFSxOI
If you omit the type then in 64 bit its automatically assumed to be .i then, right ?

Posted: Fri Jan 02, 2009 9:28 pm
by maw
SFSxOI wrote:If you omit the type then in 64 bit its automatically assumed to be .i then, right ?
.i is the default type for both x86 and x64 as of PB 4.30.

Posted: Fri Jan 02, 2009 10:04 pm
by Kaeru Gaman
maw wrote:
SFSxOI wrote:If you omit the type then in 64 bit its automatically assumed to be .i then, right ?
.i is the default type for both x86 and x64 as of PB 4.30.
and .i is 32bit on x86 and 64bit on x64

Posted: Fri Jan 02, 2009 10:08 pm
by maw
Kaeru Gaman wrote:and .i is 32bit on x86 and 64bit on x64
Well, the other way around would have been very confusing :lol: