Subj : Re: Windows Procedural Programming To : comp.programming From : alfps Date : Mon Jul 25 2005 01:40 am * 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. > I think Phlip is exagerating the complexity of a Windows SDK program (pure > C). No, not really. 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'. [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. -- 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? .