Programming Difference in 32 vs 64 bit

Started by
16 comments, last by Mas0n 18 years, 8 months ago
I've been reading the book C++ Primers 4th edition for a while now. The whole book never goes into Win32 stuff. I really don't know much about it at all so bear with me. Will there be a difference between 32 bit and 64 bit programming wise, when Microsoft's new os comes out. Because I heard Longhorn is going to be 64 bit. Does that mean we would be programming in Win64 bit or something lol? I'm extremely clueless to all of that because I have never programmed in it before. Sorry for asking stupid questions but I would like to know :). Thanks, Mason [Edited by - Mas0n on July 28, 2005 1:33:57 PM]
Advertisement
The Free Pascal compiler (AMD64 version) seems to operate the same as the 32 bit version. For C++ compilers, I wouldn't know.
Pure asm programming, yes there would change a lot..
You can find just about anything you want to know about windows programming on www.msdn.com.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/win64/win64/getting_ready_for_64_bit_windows.asp

Some highlights:

"only pointers expand to 64 bits; all other basic data types (integer and long) remain 32 bits in length."

"Initially, most applications that run on 64-bit Windows will have been ported from 32-bit Windows. It is a goal that the same source, carefully written, should run on both 32- and 64-bit Windows."

Do not cast pointers to int, long, ULONG, or DWORD.
Use the PtrToLong or PtrToUlong function to truncate pointers.

etc...
Thanks, I was looking for something like this. I was reading and I came upon this.

"The result is simplicity and a short learning curve for the developer—writing code for 64-bit Windows is just like writing code for 32-bit Windows."

So basically it's extremely similar to 32 bit, just a few things like the pointers you were talking about. The reason I asked this is that I wanted to be sure that I should learn windows api instead of wasting my money buying a soon to be outdated book.

Right now, I really don't know much about win32 or any of that stuff, but its considered win32 api programming when your using headers like windows.h and winnt.h right? So if I bought a book on how to learn win32, I wouldn't be wasteing my money seeing as how 32 & 64 bit are very similar.

I hope this all makes sense, thanks :)

Thanks,
Mason
Everything will stay mostly the same for high level language such as C++. The only difference will be when when programming in ASM.
There are some differences in Win32 and Win64, if you compile with the 'detect 64-bit issue' it will tell you what they are. Mostly it is the size differences, 64-bit windows uses 64-bit pointers for handles and things. Have not written a 64-bit windows app so I can't tell you what else.

In C/C++ i believe microsoft compiler is leaving int as 32-bit and long will now become 64-bit, which is going to be a pain if you have alot of old code that assumed long was 32-bit.. other than that it shouldn't be a big difference if you didn't assume the sizes of things.

WinNT was 64-bit on Alphas and Itaniums I think so it is not the first Win64, I have a book on Windows 2000 that mentions Win64 programming it is about 5 years old too.
"It's such a useful tool for living in the city!"
Yeah thanks for all the responses guys. Once I finish this book I'll most likely move onto win32 api. I don't have a 64 bit computer so I'll just learn win32 for now. Once Longhorn comes out, I'm going to buy a new computer seeing is how the processor I want is around 700 dollars alone :(.

Thanks,
Mason
I heard Longhorn will support the winapi and directx but with Longhorn the new api will be NET2 and there will be a new Version of DirectX( version 10) with a new name and structure.
Microsoft will still support the old APIs, but there'll be new ones, too.

The replacement for Win32 in Longhorn is WinFX which is a .net API. The new name for DX will be WGF (Windows Graphic Foundation) AFAIK.

Mas0n: Once you've finished your book I'd advise doing something other than learning the Win32 API. I think there's little point in learning it as it's old and getting replaced by newer things (e.g. WinForms) and you'll probably never need to use it. Your time could be better spent on other areas.

This topic is closed to new replies.

Advertisement