Re: Windows Procedural Programming



"Alf P. Steinbach" <alfps@xxxxxxxx> wrote in message
news:42e43108.415468250@xxxxxxxxxxxxxxxxxxxxxx
> * Joe Butler:
> > [top-posting, corrected]
>
> Please don't top-post.
>
>
> * Joe Butler:
> >
> > * Snooze:
> > > I want to begin developing Windows applications, but I don't have any
> > > experience with OOP or Windows programming; only procedural
programming.
> > > Is it possible to develop Windows applications using only a procedural
> > > programming language such as C or Pascal rather than an OOP language?
> >
> > Yes. You can create (complex) windows programs (including DirectX
> > applications) using just C.
>
> Right, although not advisable.

A matter of personal taste if you don't have any other restrictions. There
isn't ANYTHING that requires C++ in Windows that I know of. Perhaps you can
correct me on this issue. Assuming there is not, it then is a matter of how
to best implement your various layers of code (i.e. not including the
GUI/Windows API, etc. what does one prefer to use to solve the problem at
hand. If the answer is C, then that's fine - also writing the Windows code
in pure C might add a bit of time to the development, but I think I'd rather
spend take this time, personally. It's all amortised over the life of a
couple of projects, since you can reuse modules such as window creation with
a single function call, custom dialogs, etc. - each App one writes results
in more and more library helpers that are taylored to the types of things
you do.

>
>
> > I think Phlip is exagerating the complexity of a Windows SDK program
(pure
> > C).
>
> No, not really.

"But Win32 SDK is primitive and generic, so you must call _zillions_ of
functions to build this OO system." [Phlip]

By 'primitive', I'd read: 'fundamental', for 'generic', I'd read,
'fundamental'. For _zillions_, well, I've just counted how many calls need
to be made to get a window up - 7 API calls. Then it's a matter of how
complex your Window behaviour is. If it's just gonna put some text on the
screen, well, that's a 3 API calls - and 2 of those are just the markers for
the beginning and end of the graphics drawing handler. This is nothing like
the zillions mentioned.

> However, I think he's exaggerating the benefits from using
> an OO language. Those benefits are there 100% if you write a program that
> is not Windows-specific, but in that case you're not writing a Windows
> application; the Windows-specific stuff requires dealing with things that
> object oriented abstraction doesn't make simple, although it helps much.
>
>
> > A pure Windows SDK program has the following structure.
> >
> > WinMain() - instead of main()
>
> Sorry, that's incorrect.
>
> First because it's a languagecentric view (C or C++), second because
> 'WinMain' is Microsoft-specific language extension, third because even
with
> Microsoft tools 'WinMain' has a special meaning (setting tool default
> options) that's not "Windows SDK program" but "GUI subsystem program",
> fourth because there are several such special functions, e.g. 'wWinMain',
> and fifth but absolutely not least because _there is no need_ to use
> 'WinMain' or the like: you can & should just use standard C/C++ 'main'.
>

Sorry, but that's not going to mean much to a Windows beginner, is it? OK,
I'm being Developer Studio-centric, I know that main is called somewhere
else, but as far as I'm concerned, for GUI stuff, my initial entry point is
WinMain (I'd like to know where the advice says that one SHOULD use main for
a GUI program).


>
> [snip]
> > For SDK programming you could start with Programming Windows by Charles
> > Petzold.
>
> Good advice.
>
>
> > One of the things that can be difficult to get right is handling
printing
> > support (there is no built in Print Preview functionality). Also,
loading
> > things like bitmaps you have to supply the code yourself - althought I
think
> > with a new thing called GDI+ that can load bitmaps and jpegs with a
single
> > function call
>
> Sorry, that's incorrect. You could always use e.g. OleLoadPicturePath.
> However, in one practical sense it's correct unless all you want to do is
> display a photograph, for the units used for width and height are not
pixel
> based and are display-dependent, so that accuracy is thrown out the
Windows.

So, it is correct, afterall?

I didn't know about OleLoadPicturePath (I see now that it's part of IE3 -
So, I wonder how much baggage comes along with that). I shall look into it
though.

A. Signatures that are non-sequiturs.
Q. What's the most annoying thing on usenet?

>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is it such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet and in e-mail?


.



Relevant Pages

  • Re: What is the latest version of VB?
    ... I want an easy, user-friendly, and professional programming ... language that can easily manage databases, Multimedia files, Animation ... To make a long story short, Microsoft wants to ... restrict user access to Windows in order to protect ...
    (microsoft.public.vb.general.discussion)
  • Re: Starting from scratch with .Net Framework -- Where to begin?
    ... Pro., IIS is an optional Windows Component to add, but it is typically not ... You'll need your WinXP CD to install it if it is not ... Framework and then there is the language that you wish to interact with the ... "Programming Visual Basic" by Microsoft Press ...
    (microsoft.public.dotnet.framework)
  • Re: [SLE] Developing a Real Time Data System
    ... The KBasic License is valid for both operating systems: Windows and Linux. ... Modern BASIC language ... chapters learning about the programming language. ...
    (SuSE)
  • Re: General Beginner Advice
    ... It is a really nice, neat language, whose goal is, IMO, to reduce complexity ... > programming it even matters. ... I don't want to dissuade you from learning C++. ... > on the Windows platform as well as have the ability to create some web ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Reverse engineering != piracy (was Re: RosAsm disassembler output vs. IDA Pro)
    ... OOPL or fancy "class" keywords to be programming "OOP"...that stuff is ... Rene...one of your RosAsm newbies has just ... under the BASIC language, typing "?" ... surface that works within Windows...but then all "child" windows can ...
    (alt.lang.asm)