Thread: Is programming in C in Windows a reasonable option these days?

  1. #1
    Registered User
    Join Date
    Apr 2022
    Posts
    8

    Is programming in C in Windows a reasonable option these days?

    Hello, I'm no expert at programming, this is mostly just my hobby. With that said, that means it wouldn't take much for me to get in over my head. My experience in C is mostly for older platforms like the Commodore 64 and MS-DOS. I've never programmed in C++ but I have programmed in Objective-C for IOS but that was a while ago and I'd be pretty darned rusty at this point.

    So with a background like mine, would it be reasonable to create windows, deal with events, utilize the mouse, draw graphics, etc.. Or is this a fools errand? Do I need to learn C++? Is there a library for C that could make it easy?

    I'd really like to hear what your thoughts are on this?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,311
    Maybe, but there isn't a lot of choice TBH
    List of widget toolkits - Wikipedia

    The low level Win32 API is C, but you have to do a lot of work yourself if you're wanting to avoid all the creature comforts of canned UI components like dialog boxes, check boxes, scroll bars etc.

    The C++ you need for writing GUI code in C++ to use a C++ toolkit is as simple as you want to make it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2022
    Posts
    8
    Well I'm not too picky, perhaps I could just make my own menus and use them to avoid having to learn a great deal about the API in a short time. If I can get mouse clicks and window position I could do the rest. Maybe that's what I should do, then I wouldn't need extensive knowledge all at once. I could keep coding and just learn and implement the API in time. What are your thoughts? Does that seem like a reasonable approach?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,311
    Depends what you want really.

    If you're looking to make a GUI of some sort by the path of least resistance, then I can recommend WxWidgets.

    It comes with an extensive set of sample applications (which you compile yourself) to study.
    When you find a sample that does some of the things you want, you can see what that means in the code.

    If you also use code::blocks as your IDE, it comes with WxSmith as the RAD tool. You can drag and drop the UI elements and have it auto-generate all the boilerplate code for you.

    Just to be clear, you don't need to be a hardcore C++ wizard to do this.
    A basic understanding of what a class is (a fancy struct), what a method is, and how to call a method will go far.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Apr 2022
    Posts
    8
    Thank you, Salem! I think this is the perfect answer to what Iím looking for.

    By the way I am using Code::Blocks as my IDE and I had no idea what WxSmith was. This should get me up and running quickly and easily.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows' "Open with" option...?
    By \007 in forum Windows Programming
    Replies: 8
    Last Post: 01-18-2011, 05:24 PM
  2. Differences between Windows XP and Windows Vista programming
    By nathan3011 in forum Windows Programming
    Replies: 3
    Last Post: 01-15-2009, 10:05 AM
  3. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:16 PM
  4. reasonable frustum viewing distance
    By Silvercord in forum Game Programming
    Replies: 8
    Last Post: 02-27-2003, 04:24 PM

Tags for this Thread