Slashdot Mirror


Programming References for the Win32 Environment?

Pablo asks: "I have to do some programming in Windows (for school, not by choice). To say that I know jack-all about Windows programming would be flattering myself. I never do any programming under *NIX without my trusty copy of Stevens' 'Advanced Programming in the UNIX Environment' by my side. I'm wondering if there is an equivalent 'bible' reference book for Windows programming. Does anyone have any recommendations?"

2 of 86 comments (clear)

  1. Thoughts by JMZero · · Score: 3, Insightful

    As others have said, avoid MFC like the plague - just write Petzold "Programming Windows" style code. As long as you can find all the API's you need (MSDN helps, but often doesn't search well - example code is a lot better), C programming under Windows is pretty easy.

    That said, if you have the option of using .NET it's probably the best way to go right now. C#, or even VB.NET, are pretty dang easy to use. Might even make for compatible code once Mono is working.

    Either way, much better than sifting through MFC you'll never use again.

    --
    Let's not stir that bag of worms...
  2. What sort of programming, exactly? by babbage · · Score: 3, Insightful
    I don't know much about Windows programming myself, but it seems like if you want to really get into the guts of things, you'll have to deal with MFC and COM. I've never dealt with MFC, so I can't tell you anything about it, but from the little bit that I know about COM it seems to be a pretty nice system actually.

    Basically COM treats things in a client-server way, so that you can e.g. write a Python client to Excel that will let Excel do all the heavy lifting -- optionally in the background -- and then you get back the results and display them in a GUI or insert into a database or pipe out across the network or what have you. Conversely, you can write a COM server that can have Excel (or whatever, that's just the example I'm using) act as a client, with your Python (or whatever) program doing the work. Moreover, with DCOM (which seems to be the exact same thing but with an amended title), the clients & servers don't have to be on the same machine (as you'd probably expect of anything calling itself client-server). The bridge from this present-day model to the pervasively distributed .NET framework we keep hearing about should be pretty obvious.

    When you get into COM, it's much more similar to the Unix "small programs / filters" model than I was expecting, at least in certain abstract ways. Obviously you hear a lot of griping about it, especially here on Slashdot, but COM does seem to be a pretty solid framework for GUI application development, and much better than Motif, GTK, Bonobo, Swing etc, from what little I know about those systems. (I'm not trying to flame or troll, just speaking as a interested observer / non-developer of gui frameworks.)

    But again, what are you trying to do exactly? Aside from suggesting digging up some COM (and, presumably, MFC) references, the next question is what problem are you trying to solve, and what tools are you considering using? I've played around with Windows Python, based largely on what I learned about it & COM by reading Python Programming on Win32, and it seems like it isn't too hard (and it's much nicer than Visual Basic for the same tasks). I also read Dave Roth's Win32 Perl Programming: The Standard Extensions and Win32 Perl Scripting: Administrator's Handbook, and the material was good but I'm not convinced that Perl is as good of a fit for the Win32 world -- it's great for short scripts, task automation, sysadmin stuff, etc, but I don't think I'd use it for a user-driven GUI application as I would with Python. (And keep in mind that, in general, I much prefer Perl to Python, and almost always use Perl over Python on other platforms, but I'm trying to match the tool to the role here...).

    You might also want to look into Visual Basic & Access -- as a lot of Win32 apps seem to be little more than a VB front end for an Access backend -- as well as VC++, MySQL (works great on Windows, IME), Delphi (never used it but I hear nothing but great things about it), and RealBasic (Mac oriented but can cross-develop to Win32, and again I hear nothing but great things about it).