Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Elec Engineer (Image Processing/DSP) looking for C++ GUI advice....

Options
  • 20-09-2011 7:57pm
    #1
    Registered Users Posts: 78 ✭✭


    Hi all,
    I'm an electronic engineer working specialising in Image Processing.
    I'm looking to learn some C++ GUI skills. I know how to create GUIs in Java using awt/swing and have backend C/C++ skills.

    The options I've looked at are MFC, Win32 and Qt. I have a copy of Visual Studio. I know wizards are available in Visual Studio, but is this a 'proper' way to do it as used by career programmers? MFC code seems pretty awful if coding by hand :pac:

    Qt seems good and is cross platform, and the 'syntax' seems nicer. I don't mind if I'm restricted to windows tho.

    Because I'm from an E.Eng background I'm not sure what the common/popular approach is.

    Can anyone suggest which route to go down?

    Thanks


Comments

  • Registered Users Posts: 2,023 ✭✭✭Colonel Panic


    In work, a lot of our legacy stuff uses MFC. I would advise against it even if it is widely used. There's plenty of jobs that still list MFC as a skill, but I sure as hell wouldn't apply for them! Most people wouldn't use Win32 directly without some sort of wrapper on top of it in house or otherwise.

    I've been using wxWidgets on a few level editor tools for a game at home and it's quite good so far. Much better than my own crappy C++ Win32 toolkit.

    Having a basic idea of how the Win32 API works and whatever framework you like the look of is probably the best approach.


  • Registered Users Posts: 3,945 ✭✭✭Anima


    I use JUCE and love it. It's cross-platform (Windows, Linux, OSX, Android, iPhone), very good API and the coding style is very readable, forum is great for advice and problems.

    It has some DSP (mainly audio but I think theres some image stuff) classes in there as well. I came from a Java GUI background and it's quite similar, I found it quite easy to learn it from knowing Swing.

    It's free to use in non-commercial applications and the license for commercial is relatively small I think.


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Writing GUI in c++ is doing it wrong (as of 2011). Put all your code that talks to native hardware etc in a c++ dll. Then write a GUI in C# and call the needed functions in your c++ dll. Best of both worlds. Pretty easy to do, just export your functions like normal C ones, don't need to use CLR or managed c++ or anything.

    Since you talk about Visual Studio and win32 I'm guessing you want to code on windows. Above method won't work on other platforms (mono is terrible so don't expect this to work on linux).

    Some example code:

    C++ dll exports stuff like this:

    extern "C" void* WINAPI getRenderTarget()
    {
    return Renderer::getInstance()->getRenderTarget();
    }

    C# imports stuff like this:

    [DllImport("CHEEZBURGER.dll")]
    public static extern IntPtr getRenderTarget();

    The only reason anyone would write a gui in c++ these days is for cross-platform code (use Qt or wxWidgets as above). For a windows app noone uses mfc anymore, it's all C# WPF these days. Any MFC jobs are supporting legacy stuff.


  • Registered Users Posts: 78 ✭✭wildswan


    Thanks guys!
    That helps a lot. Will stay away from MFC for now so!
    Will check out JUCE and wxWidgets for now.

    Would be interested in looking at C#.....on first glance it looks like a mutant hybrid of C++ and Java. Will see if I can hack out a few lines.

    Thanks dudes :)


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Another keep away from MFC. I'm working with it extensively in work and I've come from a QT background. The difference is staggering. MFC makes you want to pull your hair out and the documentation sucks. (Of course reading the code is probably the best way).

    Consider QT, it's a beautiful framework that is well documented and plenty of support on the qt-interest mailing lists. QT supply a range of other things outside of GUI components such as Cross platform threading/concurrency/networking frameworks.

    I've also worked with C# and WPF. This does make creating GUI's really quick.


  • Advertisement
  • Registered Users Posts: 2,149 ✭✭✭dazberry


    Just to add to the mix you could also look at C++ Builder, which supports RAD based form design (think WinForms on steroids). Feature matrix is here.

    HTH

    D.


  • Closed Accounts Posts: 4,436 ✭✭✭c_man


    +1 for Qt.

    Working with a derivative of WPF at the mo :( How I long for my Qt days.


Advertisement