Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why Windows Programing is so complicated?

426 views
Skip to first unread message

SantiX

unread,
Nov 8, 2002, 4:42:53 AM11/8/02
to
Hi,

Why there are so many different data types for everything, so many
disperse API and MFC functions??

For example, if you want to deal with the Registry, why there is not a
Registry class that wraps all the functionallity in an OOP way instead
of a bunch of functions?

I think it would be very helpful to have a documentation like JavaDoc,
with a set of clasess and the list of all of its constructors, methods
and properties with their descriptions. I find that instead of this,
MSDN is an enormous list of unrelated funtions.

I like the C++ languaje, but every time I have to deal with windows
programming and MSDN I think that if it is so popular and extended, I
should be missing some point. Maybe someone can make me see the light
here!

regards

Quixote

unread,
Nov 8, 2002, 5:15:13 AM11/8/02
to

"SantiX" <infor...@ibcentre.es> wrote in message
news:adbd9b93.02110...@posting.google.com...

Windows has been around for more than a decade and most of the initial
development was done in C rather than C++. A C interface has been retained
for most API functions for compatibility.

Over that decade+, everything has been done in a hurry. Microsoft has been
rushing to add features because it figured (correctly) that doing so was the
way to dominate the market.

Of course, if Microsoft was to redo it all now at its leisure and with the
benefit of hindsight, it would be possible to design a much more elegant
API. But what we now have is a product of history. We have to live with it.

--

Quixote
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)


Stephen Kellett

unread,
Nov 8, 2002, 6:09:44 AM11/8/02
to
>I think it would be very helpful to have a documentation like JavaDoc,
>with a set of clasess and the list of all of its constructors, methods
>and properties with their descriptions.

I would agree, except for the fact that everytime I look at
documentation produced using javaDoc, you get a load of 'documented'
functions with trivial descriptions and an implied understanding of how
all the classes work together. No better or worse than MSDN, except that
MSDN comes with a large knowledgebase and sample articles.

>I find that instead of this,
>MSDN is an enormous list of unrelated funtions.

At the bottom of each function definition is a list of related
functions. Hit the locate button and you are synchronised with the
appropriate portion of the help index. Use the search tab to find
related articles.

Its not brilliant, its worse in VS7 (because help is now not a separate
process), but its very usable.

Stephen
--
Stephen Kellett http://www.objmedia.demon.co.uk
Object Media Limited C++/Java/Windows NT/Unix/X Windows/Multimedia
If you are suffering from RSI, contact me for advice.
Unsolicited email from spam merchants not welcome.

Lucian Wischik

unread,
Nov 8, 2002, 6:40:50 AM11/8/02
to
SantiX <infor...@ibcentre.es> wrote:
>For example, if you want to deal with the Registry, why there is not a
>Registry class that wraps all the functionallity in an OOP way instead
>of a bunch of functions?

Heh. Out of all the APIs I've used, it's always the OOP-ones that were
worst structured and worst documented. And the procedural ones that were
clearest.

(I'm not an OOP-luddite! I write all my programs object orientedly, have
supervised OO design+programming to students, have written lots of
O-oriented components &c.)

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. www.wischik.com/lu

Stephen Kellett

unread,
Nov 8, 2002, 8:09:03 AM11/8/02
to
In message <aqg7s2$7ij$1...@pegasus.csx.cam.ac.uk>, Lucian Wischik
<ljw...@cus.cam.ac.uk> writes

>SantiX <infor...@ibcentre.es> wrote:
>>For example, if you want to deal with the Registry, why there is not a
>>Registry class that wraps all the functionallity in an OOP way instead
>>of a bunch of functions?
>
>Heh. Out of all the APIs I've used, it's always the OOP-ones that were
>worst structured and worst documented. And the procedural ones that were
>clearest.

Indeed, this mirrors my comment about the Java related documentation. Oh
look that int is called 'handle', thats useful!

>(I'm not an OOP-luddite! I write all my programs object orientedly, have
>supervised OO design+programming to students, have written lots of
>O-oriented components &c.)
>

I love OO stuff.

Jerry Coffin

unread,
Nov 8, 2002, 10:55:29 AM11/8/02
to
In article <P8My9.19701$W4.12...@news.randori.com>,
donald...@datafast.net.au says...

[ ... ]

> Windows has been around for more than a decade and most of the initial
> development was done in C rather than C++.

In fact, it's starting to get close to two decades. Much of the
initial development wasn't in C++ OR C: it was in assembly language.
Keep in mind that when Windows 1.0 came out, a high-end desktop
machine had a slower processor and less memory than the cheapest Palm
Pilot does now. Just getting Windows to run at all on the machines
available then was quite a trick.

> Of course, if Microsoft was to redo it all now at its leisure and with the
> benefit of hindsight, it would be possible to design a much more elegant
> API. But what we now have is a product of history. We have to live with it.

In fact, they DID redo it all, largely at their leisure. The API was
nice, but OS/2 barely qualifies for more than a footnote in history
now.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Borromeo

unread,
Nov 8, 2002, 6:11:50 AM11/8/02
to
On 8 Nov 2002 01:42:53 -0800, infor...@ibcentre.es (SantiX) wrote:
> Hi,
>
> Why there are so many different data types for everything, so many
> disperse API and MFC functions??
Because it's existed for a long time and the stuff accumulated. Windows is older than
both Java and C++, the API is not object-oriented in the current meaning of the term,
many later attempts to provide something on top of the original Windows API left a lot
of debris for the Windows programmer to wade through. I don't mean that it's all
useless, btw, I'm simply explaining why it's so unstructured, disconnected, and
obviously, confusing for a newcomer.

> I think it would be very helpful to have a documentation like JavaDoc,
> with a set of clasess and the list of all of its constructors, methods
> and properties with their descriptions. I find that instead of this,
> MSDN is an enormous list of unrelated funtions.

As far as the API itself, this is somewhat true (though you will notice that functions
are gatered in families, related to this or that particular functionality); but if you
look at something like MFC or ATL, this will be different. But these were introduced
much later.


> I like the C++ languaje, but every time I have to deal with windows
> programming and MSDN I think that if it is so popular and extended, I
> should be missing some point.

No, that's it, you are right in a sense that even today there hasn't been a good and
universally accepted OO framework for Windows programming -- some people prefer to use
the bare API and build what they want themselves on top of it, some other people use
MFC, and so on and so forth. So, your confusion is entirely justified and legitimate,
that's how it is with Windows.

Sin

unread,
Nov 8, 2002, 11:32:33 AM11/8/02
to
> Why there are so many different data types for everything, so many
> disperse API and MFC functions??

They are not disperse. The problem is MSDN. It has all the info you'll ever
want to know about what it covers BUT it's interface is structured very
badly for such a huge amount of data. The search tool is crap to begin with
and the index is way too big to provide any help unless you know what you're
looking for.

I recomment that you look for alternative help sets. There are plenty
covering the Win32 API which clarify things ALOT for someone who didn't get
an overview of the API.


> For example, if you want to deal with the Registry, why there is not a
> Registry class that wraps all the functionallity in an OOP way instead
> of a bunch of functions?

There's one in MFC. CRegistry. Works great.

Otherwise the procedural API functions work great. You just have to check at
the 'Registry Functions' index page of MSDN.

Finding that page is the hard part. It helps to know one of the functions
(ex: RegOpenKey). Locate it in the index, open it's page, and go to the
'Registry Functions' link at the bottom.


> I think it would be very helpful to have a documentation like JavaDoc,
> with a set of clasess and the list of all of its constructors, methods
> and properties with their descriptions. I find that instead of this,
> MSDN is an enormous list of unrelated funtions.

As said, the content is there. The interface to it is crap.


> I like the C++ languaje, but every time I have to deal with windows
> programming and MSDN I think that if it is so popular and extended, I
> should be missing some point. Maybe someone can make me see the light
> here!

Being on this newsgroup helps alot. You just have to remember Win32 pretty
much has an answer to every problem. If you can't find the function or set
of functions that will help you solve your problem, ask here, and someone
will know. After some time you'll know more and more about it, and ask
questions less, and less...

Alex.


David O Bringen

unread,
Nov 8, 2002, 8:01:47 PM11/8/02
to

Windows was an early GUI app, actually a shell for MS-DOS. By Win95,
it finally became its own independant multi-tasking O/S. Sorta. Well,
as good as they could get, anyway. NT was something else, to put it
mildly.

Remember that when in DOS, your app is GOD. It OWNS every bit of RAM
and can play Life and Death with any port. You don't have to worry
about anything, because you are beholding only to your own judgement.

But under Windows, WINDOWS is God. Your app must ask for a service
request number, which it then uses to file plans for a window. After
Windows comes back with formal approval, your app must then submit
another request to open the window. Once open, its job is to receive
and rebroadcast all of Window's myriad system messages, sneaking the
opportunity every now and then to pocket a message of interest to you.

All that API stuff is meant to put several layers of separation
between you, the programmer, and Windows, the World Honored One. It's
to make sure that programmers like me, who keep trying to imbed
machine language code to push stacks and poke memory ports, don't wind
up hosing all the programs, threads and processes open at any one
time.


Frank Adam

unread,
Nov 8, 2002, 10:12:26 PM11/8/02
to
On 8 Nov 2002 01:42:53 -0800, infor...@ibcentre.es (SantiX) wrote:

>Hi,
>
>Why there are so many different data types for everything, so many
>disperse API and MFC functions??
>
>For example, if you want to deal with the Registry, why there is not a
>Registry class that wraps all the functionallity in an OOP way instead
>of a bunch of functions?
>

And thank god there isn't. do i really want to fire up a perhaps
bloated class associated with a given group of APIs when i dont need
to ?

>I think it would be very helpful to have a documentation like JavaDoc,
>with a set of clasess and the list of all of its constructors, methods
>and properties with their descriptions. I find that instead of this,
>MSDN is an enormous list of unrelated funtions.
>

I thought the MSDN is realtively well organized actually, it's search
sucks but otherwise it's ok..

>I like the C++ languaje, but every time I have to deal with windows
>programming and MSDN I think that if it is so popular and extended, I
>should be missing some point. Maybe someone can make me see the light
>here!
>

Encapsulate them into your own class library and away you go. This is
nothing new, before Windows we were writing our own libraries to ease
the job and IMO it is one of the best exercises for anyone trying to
grasp the functionality of APIs . By the time you succesfully wrapped
it, you will have no problem understanding any of it. :-)

Russ Freeman

unread,
Nov 9, 2002, 6:18:28 AM11/9/02
to
"Stephen Kellett" <sn...@objmedia.demon.co.uk> wrote in message
news:0AnkSAD4...@objmedia.demon.co.uk...

> Its not brilliant, its worse in VS7 (because help is now not a separate
> process), but its very usable.

With some tweaking in the options you can make VC7 behave like VC6 -
including the annoyance you mentioned.

--
russ.
http://www.gipsysoft.com/articles/winspector/ - FREE Spy++ replacement.
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids


Jussi Jumppanen

unread,
Nov 9, 2002, 8:36:42 AM11/9/02
to
Sin wrote:
>
> > Why there are so many different data types for everything, so many
> > disperse API and MFC functions??
>
>
> They are not disperse. The problem is MSDN. It has all the info you'll
> ever want to know about what it covers BUT it's interface is
> structured very badly for such a huge amount of data. The search tool
> is crap to begin with and the index is way too big to provide any help
> unless you know what you're looking for.
>
> I recomment that you look for alternative help sets. There are plenty
> covering the Win32 API which clarify things ALOT for someone who
> didn't get an overview of the API.

An probably one of the best is the free Win32 API's in WinHelp format
as written by Borland, which can be found here:

ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/win32.zip

or here:

http://www.borland.com/devsupport/borlandcpp/patches/BC52HLP1.ZIP

This help file is an excellent sources of documentation that cover
the Win32 API's in great detail.

And if you use Zeus as your IDE (shareware) you can even add these
and other help file to the Zeus Quick Help engine which puts all
this information at your finger tips :)

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, HTML, FTP, Python, PHP, Perl programmer's editor"
http://www.zeusedit.com

Lucian Wischik

unread,
Nov 9, 2002, 9:28:36 AM11/9/02
to
Jussi Jumppanen <jus...@zeusedit.com> wrote:
>An probably one of the best is the free Win32 API's in WinHelp format
>as written by Borland, which can be found here:
> ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/win32.zip

I don't get it. Borland's win32.hlp &c. are just a cut-down version of
parts of the PlatformSDK (including the same chapter overviews and api
explanations) but not as complete, and with examples missing. Don't people
find MSDN better than borland's help file?

John Brown

unread,
Nov 9, 2002, 9:09:13 PM11/9/02
to
ljw...@cus.cam.ac.uk (Lucian Wischik) wrote in message news:<aqj62k$o1t$1...@pegasus.csx.cam.ac.uk>...

> Don't people
> find MSDN better than borland's help file?

Perhaps, but the Core SDK is a 200MB download. Even if you could
de-select the items that you might think you could do without (32-bit
and 64-bit build environments and maybe sample code, it would still be
89.5MB. Of course, working with the most up-to-date documentation is
good, and you can always order the CD free (plus shipping and
handling, of course) at:

http://qmedia.e-storefront.com/product.asp?productid=24

Serve Laurijssen

unread,
Nov 10, 2002, 5:00:57 AM11/10/02
to

"Lucian Wischik" <ljw...@cus.cam.ac.uk> wrote in message
news:aqj62k$o1t$1...@pegasus.csx.cam.ac.uk...

> Jussi Jumppanen <jus...@zeusedit.com> wrote:
> >An probably one of the best is the free Win32 API's in WinHelp format
> >as written by Borland, which can be found here:
> > ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/win32.zip
>
> I don't get it. Borland's win32.hlp &c. are just a cut-down version of
> parts of the PlatformSDK (including the same chapter overviews and api
> explanations) but not as complete, and with examples missing. Don't people
> find MSDN better than borland's help file?

I agree, when I have to work with C++Builder I fire up MSDN, because
Borland's own help is very minimal. I do a lot of ATL coding, and there's
almost nothing about it in borland's help.


rainman

unread,
Nov 10, 2002, 12:27:22 PM11/10/02
to

"Stephen Kellett" <sn...@objmedia.demon.co.uk> wrote in message
news:0AnkSAD4...@objmedia.demon.co.uk...
> >I think it would be very helpful to have a documentation like JavaDoc,
> >with a set of clasess and the list of all of its constructors, methods
> >and properties with their descriptions.
>
> I would agree, except for the fact that everytime I look at
> documentation produced using javaDoc, you get a load of 'documented'
> functions with trivial descriptions and an implied understanding of how
> all the classes work together. No better or worse than MSDN, except that
> MSDN comes with a large knowledgebase and sample articles.

I agree. Using the Windows API has been far easier to learn for me than the
Java classes (and don't even bring up interface layout).

Stephen Kellett

unread,
Nov 10, 2002, 12:59:07 PM11/10/02
to
>I agree. Using the Windows API has been far easier to learn for me than the
>Java classes (and don't even bring up interface layout).

Ah yes, the joys of the GridBagLayout concept...oh sorry you asked me
not to mention that :-)

Jussi Jumppanen

unread,
Nov 10, 2002, 4:35:11 PM11/10/02
to
Lucian Wischik wrote:

>> An probably one of the best is the free Win32 API's in WinHelp
>> format as written by Borland, which can be found here:
>>
>> ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/win32.zip
>
> I don't get it. Borland's win32.hlp &c. are just a cut-down version
> of parts of the PlatformSDK (including the same chapter overviews
> and api explanations) but not as complete, and with examples missing.
> Don't people find MSDN better than borland's help file?

I can not talk for anyone else but what I find is 99 % of what I
need to know is covered by the Borland help file. The things I
refer to are Win32 structures, WM_* messages and the multitude of
Win32 standard API's (CreateProcess, CreateFont etc etc). If I
attach that Borland help file to the Zeus quick search feature
I have access to all this information and only need to put up
with search times of less than a second.

But if I was to run the same search in MSDN not only is the search
much slower the results of the search are corrupted since they also
contain irrelivant information on Word, Excel, Visual Basic, Visual
Foxpro, Visual XXX etc etc.

I have also noticed that the over the years Micrsoft seems to use
the MSDN a as tool to push their own products. The very early
versions of the MSDN where exceptionally good with lots of Win32
examples written in straight Win32 C. These days most examples are
written in VB, MFC and the new kid on the block C#.

Give my Borland Win32.hlp and deja.com and I have the answer to
almost every Win32 development question :)

Lucian Wischik

unread,
Nov 11, 2002, 5:05:36 AM11/11/02
to
Jussi Jumppanen <jus...@zeusedit.com> wrote:
>[borland win32.hlp] search times of less than a second.

>But if I was to run the same search in MSDN not only is the search
>much slower the results of the search are corrupted since they also
>contain irrelivant information on Word, Excel, Visual Basic, Visual
>Foxpro, Visual XXX etc etc.

Both good points! As you say, whenever I hit F1 in VS.NET to find the
documentation for the api function DoSomething, it always instead takes me
to the stupid CCrummyMfcClass::DoSomething instead! (probably you can turn
this off, but I haven't figured out how...) My solution is to leave MSDN
always open to avoid the slow startup time, and always to search in the
index rather than by pressing F1.

--
Lucian

jetmarc

unread,
Nov 12, 2002, 7:36:39 AM11/12/02
to
> I recomment that you look for alternative help sets.

Would you name your favourite one please?

Marc

Sin

unread,
Nov 12, 2002, 9:34:11 AM11/12/02
to
> > I recomment that you look for alternative help sets.
>
> Would you name your favourite one please?

I personally use MSDN because through the years I've learned to live with
it. It's a love/hate relationship but I function well in it :)

Here are two URLs which I've used in the past :

http://www.winprog.org/faq/
http://www.iseran.com/Win32/

The Windows SDK also comes with a Win32 only help file which is well
structured. I don't think it's on the MSVC disks but you can download the
SDK freely from MS's site.

Alex.


0 new messages