Jump to content
  • Advertisement
Sign in to follow this  
jdub

Why is Win32 so messy?

This topic is 3646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am confused at several features of the Win32 API. 1. Why are types macroed or typedefed? (I dont think these are words:)) ex: INT, DWORD 2. Why are functions #defined from their original names? ex: typedef CreateWindowW(...) CreateWindow(...) 3. Is Microsoft ever going to replace the Win32 API with newer API? thanks... jdub

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by jdub
I am confused at several features of the Win32 API.

1. Why are types macroed or typedefed? (I dont think these are words:))
ex: INT, DWORD

2. Why are functions #defined from their original names?
ex: typedef CreateWindowW(...) CreateWindow(...)

The goal was maintainability. If they ever needed to change some fundamental structure of the library, they didn't need to tell all programmers to update their code.

Quote:

3. Is Microsoft ever going to replace the Win32 API with newer API?

They already did. See .NET.


I just got ninja-ed..

Share this post


Link to post
Share on other sites
Quote:
Original post by jdubWhy are types macroed or typedefed? (I dont think these are words:))ex: INT, DWORD
They're typedefs to support backwards compatibility with Win16 (where an INT is a 16-bit type and a DWORD is 32 bits), forwards compatibility with Win64 and beyond, and compatibility across different compilers and so forth.

Quote:
Original post by jdub2. Why are functions #defined from their original names?
ex: typedef CreateWindowW(...) CreateWindow(...)
To support porting old ANSI programs to Unicode with minimal source changes, and doing so as smoothly as possible in C. It's was also designed to allow applications both for Win16 and NT to be compiled from the same codebase.

Quote:
3. Is Microsoft ever going to replace the Win32 API with newer API?
That would depend on what you mean by replace. It won't go away completely anytime soon, Microsoft is a company build on backwards compatibility after all, but over the years any number of newer APIs and wrappers have been offered for parts of Win32 (e.g. .NET and so forth.)

Share this post


Link to post
Share on other sites
.NET is more of a wrapper than a replacement, at least .NET is as much of a Win32 replacement as MFC was.

oh, and the reason alot of functions have similar functions ending with W, is to facilitate unicode, when unicode is enabled, all the standard functions (like MessageBox()) are changed to things like MessageBoxW(), which is the WideCharacter(unicode) version of the function

what you have to realize is that the Win32 api was written a LONG time ago, and they were more concerned with just getting stuff to work(if you've ever seen the Windows95 bootloader code, you'd understand)how many other current api's have 15 -20ish year old design structure.

why don't they re-design their C api... 2 reasons, backwards compatability, and the fact that microsoft has completely lost touch with the reality of their market, and have resigned themselves to using their absolute stranglehold on the market to pass off products that are unimaginative, or a slight variation of their competeor's procducts

but enough with my diatribe. that being said, win32 is much more manageable than development for Mac, and to an extent Linux, IMHO

Share this post


Link to post
Share on other sites
Actually, Microsoft has replaced their API's continuously, and never deprecated
any of the replaced APIs. That's why there is frequently a whole zoo of functions that all do approximately the same thing. The good news is that
even very old DOS programs still run. Than bad news is bloat, bugs, and a minefield of choices for programmers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!