-
May 15th, 2014, 02:04 PM
#1
Replacing GUI in a Win32 application - best strategy?
Hello,
I have a Win32 C++ application which works pretty well, but I don't like the GUI and I want to replace it with one designed graphically, a la Windows Forms. What is the best strategy to port my code? I tried creating a new Windows Forms C++ application and got pretty far with it, but was stymied when trying to call my unmanaged functions on a button press (if anyone knows how to do that, help would be appreciated; I googled and found a lot of admonitions about not mixing managed and unmanaged code). If I can't use Forms to add a GUI without completely rewriting the program, what's my best bet?
-
May 15th, 2014, 02:15 PM
#2
Re: Replacing GUI in a Win32 application - best strategy?
-
May 15th, 2014, 02:23 PM
#3
Re: Replacing GUI in a Win32 application - best strategy?
-
May 15th, 2014, 03:52 PM
#4
Re: Replacing GUI in a Win32 application - best strategy?
A good strategy could be to switch to a portable GUI.
Have a look at primarily wxWidgets but also Qt.
http://www.wxwidgets.org/
Last edited by zizz; May 16th, 2014 at 12:45 AM.
-
May 15th, 2014, 04:11 PM
#5
Re: Replacing GUI in a Win32 application - best strategy?
Of the suggestions above, is it true that only MFC be used to graphically build GUIs within Visual Studio?
-
May 15th, 2014, 04:18 PM
#6
Re: Replacing GUI in a Win32 application - best strategy?
Victor Nijegorodov
-
May 15th, 2014, 06:35 PM
#7
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by Danja91
Of the suggestions above, is it true that only MFC be used to graphically build GUIs within Visual Studio?
No. It's included with Visual Studio, but the others mentioned will work with it as will .Net and the Windows API.
-
May 16th, 2014, 04:27 AM
#8
Re: Replacing GUI in a Win32 application - best strategy?
Note that MFC doesn't come with the free Visual Studio Express editions.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 17th, 2014, 02:23 PM
#9
Re: Replacing GUI in a Win32 application - best strategy?
Thanks to all for your advice. I have so many hours sunk into my Windows Forms application that I've decided to slowly keep chipping away at that. My calls to unmanaged code suddenly started working (I have no idea what I did differently - I suspect that it may have been a Visual Studio bug because all I did was reload the solution) so I'm on my way again. I investigated MFC and WTL as fallback options; thanks for pointing me to them.
-
May 17th, 2014, 02:31 PM
#10
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by Danja91
... My calls to unmanaged code suddenly started...
Note that MSFT guys call "unmanaged code" as a native one!
Victor Nijegorodov
-
May 18th, 2014, 01:02 AM
#11
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by Danja91
WTL as fallback
Although I'm using WTL myself I would describe it as obscure and clandestine. It's mostly for old school die hard Win32 developers who are only comfortable close to the metal. I was about to say that it's hardly ever updated anymore when I found that it recently actually was,
http://sourceforge.net/projects/wtl/...?source=navbar
Still I would think twice before I used WTL for new mainstream developments. For native developments (unmanaged code) and if you're not forced to stick to MS technologies I would strongly recommend wxWidgets or Qt. Both are in active development, supported by large communities, free, and most importantly, they're portable. If we're talking strategy the latter is a big point I think.
Last edited by zizz; May 18th, 2014 at 05:34 AM.
-
May 18th, 2014, 10:15 AM
#12
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by zizz
Although I'm using WTL myself I would describe it as obscure and clandestine. It's mostly for old school die hard Win32 developers who are only comfortable close to the metal.
I doubt that many old school die hard Win32 developers who code in straight Win32 would use a framework like WTL. If they did, they wouldn't be old school die hard Win32 developers.
-
May 18th, 2014, 02:12 PM
#13
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by Arjay
I doubt that many old school die hard Win32 developers who code in straight Win32 would use a framework like WTL. If they did, they wouldn't be old school die hard Win32 developers.
You mean it's a contradiction in terms? One cannot be a die-hard Win32 programmer and a WTL user at the the same time?
Apart from sounding like a die-hard xxxx I think you're dead wrong. WTL is the perfect excuse to cling on to Win32 just a little bit longer.
Last edited by Arjay; May 18th, 2014 at 06:28 PM.
Reason: Removed profanity.
-
May 18th, 2014, 02:25 PM
#14
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by zizz
... I think you're dead wrong.
"wrong" with what?
Arjay wrote (and it is very clear!) that he doubts...
Is it equal for you to "be doubt" and to "contradict"?
Victor Nijegorodov
-
May 18th, 2014, 06:39 PM
#15
Re: Replacing GUI in a Win32 application - best strategy?
Originally Posted by zizz
You mean it's a contradiction in terms? One cannot be a die-hard Win32 programmer and a WTL user at the the same time?
Apart from sounding like a die-hard xxxx I think you're dead wrong. WTL is the perfect excuse to cling on to Win32 just a little bit longer.
Back off on the insults, Zizz. At any rate, it's been my experience that Win32 programmers that code using a WinProc generally prefer that approach and don't usually move to a framework.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|