Is C++ suitable for GUI programs?

R

Raymond

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image. We're encouraged to use Visual C++ or Java because they're more
suited to multimedia. I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure. I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?
 
W

Werner

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image.  We're encouraged to use Visual C++ or Java because they're more
suited to multimedia.  I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure.  I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?

We use Qt4 and that seems quite easy to work with. For
graphing we use Qwt Graph. I know of other good C++ GUI
libraries that exist too, but we've mainly used Qt.

Regards,

Werner
 
G

Goran

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image.  We're encouraged to use Visual C++ or Java because they're more
suited to multimedia.

Visual C++ is C++ language implementation _and_ additional libraries
_and_ development environment (editor, debugger, project management,
code navigation, source control...) So Visual C++ __is__ C++. It's
suited to multimedia because you have libraries for it that you can
use. But you have libraries for other C++ toolchains, too.

In other words, there's nothing in Visual C++ that inherently makes it
"suited to multimedia".
 I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure.  I do know Java and some C#.

You don't know C++, but you say it's faster (than... I don't know
what)? Don't do suppose like that. Sure, __chances are__ that some C++
code will be faster when doing X than e.g. Java code, but in __no
way__ is this implied. In fact, if you have e.g. a good JPEG
processing library in Java, changes are, it will be faster, more
comprehensive and with less bugs than something I or you would come up
with C++.
Would it be better to create a GUI in C# and have C++ to do the processing?

Do you know how to integrate them? If so, OK. If not, how will you do
it?

If you already know Java (or anything else), and are not sure e.g.
about C++, and you want good results, tend to stick with what you
know. Too much venturing into unknown is risky, and I feel thet's
exactly what you're doing here.

Goran.
 
R

Rune Allnor

So I've heard that creating GUI programs in C++ is quite difficult.

Define 'difficult'.

One main issue to consider is the availability of tools, with
documentation, to do the job. There are other toolchains for
making GUIs, that are far more popular than C++. Which means
these other tools are easier to come by, documentation is
easier to find, and help is easier to get, than if you
choose to use C++.

Whether that is a difficult property of the *language* C++
is a matter of semantics (I can't think of anything you can do
with another language, that you can not do with C++); it might
certainly be a difficulty when *working* with C++.

Rune
 
N

Noah Roberts

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image. We're encouraged to use Visual C++ or Java because they're more
suited to multimedia. I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure. I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?

The GUI libraries that come with Visual C++ for the C++ language are
VERY primitive. They are ... tedious to work with.

If you use the C++/CLI language then you have access to the .Net UI
library. It's more modern.

You also have the option of 3rd party libraries like Qt or Wx.
 
P

Paul

Raymond said:
So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image. We're encouraged to use Visual C++ or Java because they're more
suited to multimedia. I'm thinking of using C++ (don't know it yet) cause
it's faster but since the GUI is a big part of it and considering how
difficult it is... I'm not sure. I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the
processing?
Who is encouraging you to use VisualC++?

Visual C++ is,debatably, a term not a language. It is a term that can pretty
much be summed up as meaning using MFC(Microsft foundation classes) and it
is pretty much out of date AFAIK.
VC++ and MFCs are microsoft specifc and if you are going that way I would
use the more supported dotnet libraries (using C# or managed C++, both of
which are easily interoperable).

Standard C++ can be used to write windows GUI's using the windows API ,
and/or DirextX api. Which is what you would need to learn to gain and speed
advantage over dotnet compiled programs.

If you already know java you could wirte 100 java swing programs (or
whatrever the latest gui package is ) in the same time it would take you to
learn C++ && windowsapi && directx. So stick with java or C# for your
assignment but by all means learn C++ too. Learning C++ will also give you a
basic understanding of C and manged C++.

I learned C++ before Java and I finfd the Java inheritance system a little
back-to-front from C++ which is a little cofusing. You may find a reversal
of the same going from Java to C++.
GL.
 
N

Nobody

There must be hundreds of standard JPEG libraries out there

"Hundreds of" and "standard" are mutually contradictory. If there's a
"standard" JPEG library, it's either the one from the IJG (Independent
JPEG Group), or the one supplied as part of the OS (on Linux, that's the
IJG one). There might also be some other (i.e. non-standard) JPEG
libraries, but probably not hundreds of them.
 
C

Chris M. Thomasson

Andy Champ said:
That's exactly what we do on our project. C++ gives us more of the
bit-twiddling level of control that we need for our particular specialist
application. C# is designed to bolt onto the back of the GUI, and the
.NET libraries do a pretty good job. However be aware you are then tying
yourself to Windows.

http://www.mono-project.com

[...]
 
M

MikeP

Noah said:
The GUI libraries that come with Visual C++ for the C++ language are
VERY primitive. They are ... tedious to work with.

But (the Win32 API) is close to the OS, i.e., low-level. .Net is built on
top of the Win32 API.
If you use the C++/CLI language then you have access to the .Net UI
library. It's more modern.

He'll have to decide on whether to use WinForms or WPF if he decides to
go with the higher-level MS APIs. When choosing those higher-level APIs,
one should seriously consider C# over C++ for C# is really geared toward
making GUI development using the VS IDE much easier than with C++.
You also have the option of 3rd party libraries like Qt or Wx.

Which turns back the clock to the days of MFC and OWL, probably.
 
M

MikeP

It depends on what "the processing" is. There's a bunch of .Net
facilities that you may want to use and there are probably others that
you wouldn't want to use. The .Net file system APIs are horrendous, IMO,
for example. OTOH, if your "processing" is much lower level, number
crunching, e.g, C++ sounds like a more fitting choice. Of course, not
even mentioned yet is C++/CLI which is quite a different animal than C++,
which you will want to consider.

There's nothing easy about making the above kinds of decisions. If there
is time (as in, over the course of your development "career"), do a
little of each and get a feel for the issues; not just general issues,
but what the consequences mean for you and/or who ever you are
programming for/with.
 
Ö

Öö Tiib

We use Qt4 and that seems quite easy to work with. For
graphing we use Qwt Graph. I know of other good C++ GUI
libraries that exist too, but we've mainly used Qt.

+1 to that. It is piece of cake to throw fine looking and portable C++
GUI together using Qt tools. It is not too hard to embed a GUI module
that is made with Qt into existing application that has most GUI made
with MFC.

One (pseudo-)issue that i have encountered is that Qt never destroys
some of its singletons so Visual Studio's debugger reports these as
leaked. It can be silenced by turning the leak-detection temporarily
off when the singletons are allocated. Other issue is that the amount
of tinkering that is needed to embed non-Microsoft tools into VS IDE
is growing from version to version. IDE that is losing ability to
integrate tools? Other, well-known free and open source IDEs may pass
Visual Studio that way.

C++/CLI don't look at, it is very sad monster language. The Microsoft
tools often hide that it is C++/CLI and call it "C++ with managed
extensions enabled" and other such nonsense. That makes C++/CLI a good
tool for discrediting C++. C++ is fine, platform neutral language and
has nothing to do with C++/CLI. Take C# when you target .Net as
platform, it wins C++/CLI in all aspects.
 
J

Jorgen Grahn

On 24/06/2011 07:28, Raymond wrote: ....

"I need to implement JPEG" - that sounds odd. There must be hundreds of
standard JPEG libraries out there, surely one does what you want. Good
compression is a real art.

Which also includes security (coping with input explicitly designed to
break the decoder).

But surely this must be an advanced exercise in some algorithms
course? Although that doesn't explain why the assignment includes a
GUI, which would just divert attention from the main task.

The way I'd do it is to implement command-line tools just like the
standard cjpeg and djpeg, jpegtran etc in C++. Then do a quick hack of
a GUI in some language, not necessarily C++. That GUI would execute
the command-line tools.

/Jorgen
 
N

Noah Roberts

Noah Roberts wrote:

Which turns back the clock to the days of MFC and OWL, probably.

Hardly. I don't know OWL, but MFC lacks a great deal of very important
constructs. Even the basics like layout managers are missing.
 
V

Virchanza

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image.  We're encouraged to use Visual C++ or Java because they're more
suited to multimedia.  I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure.  I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?


I did a GUI program in C++ using the wxWidgets library. The wxWigets
library is portable across MS-Windows, Mac OS, Linux, among others.

I've a webpage about it:

http://virjacode.com/projects/dynamo
 
H

hanukas

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image.  We're encouraged to use Visual C++ or Java because they're more
suited to multimedia.  I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure.  I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?

It's a breeze to create a managed C++ application with .NET framework.
It depends how much knobs and dials you want into your interface. You
could go with Direct2D, Direct3D or OpenGL if you want fancy graphical
features of GPU processing of the displayed data. It's possible to
keep things really simple or go broke with feature fever, hard to tell
from your post.
 
V

Virchanza

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image.  We're encouraged to use Visual C++ or Java because they're more
suited to multimedia.  I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure.  I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?


I find C++ fine for writing GUI programs.

I wrote a GUI program using the wxWidgets library. wxWidgets is
portable across Linux, Mac OS, MS-Windows. Here she is:

http://virjacode.com/projects/dynamo
 
L

Lynn McGuire

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the image. We're encouraged to use Visual C++ or Java because
they're more suited to multimedia. I'm thinking of using C++ (don't know it yet) cause it's faster but since the GUI is a big part of
it and considering how difficult it is... I'm not sure. I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?

This issue has been addressed by the great Paul DiLascia:
"C++ Q&A;: Displaying a JPG in your MFC Application:":
http://msdn.microsoft.com/en-us/magazine/cc301454.aspx

The code is at:
http://msdn.microsoft.com/en-us/magazine/bb985601.aspx

Lynn
 
M

MikeP

Öö Tiib said:
C++/CLI don't look at, it is very sad monster language. The Microsoft
tools often hide that it is C++/CLI and call it "C++ with managed
extensions enabled" and other such nonsense. That makes C++/CLI a good
tool for discrediting C++. C++ is fine, platform neutral language and
has nothing to do with C++/CLI. Take C# when you target .Net as
platform, it wins C++/CLI in all aspects.

C# is easily decompiled, so if you have any trade secret code, C# is a
bad choice.
 
V

Virchanza

So I've heard that creating GUI programs in C++ is quite difficult.

I need to implement JPEG with a GUI to select settings and display the
image.  We're encouraged to use Visual C++ or Java because they're more
suited to multimedia.  I'm thinking of using C++ (don't know it yet)
cause it's faster but since the GUI is a big part of it and considering
how difficult it is... I'm not sure.  I do know Java and some C#.

Would it be better to create a GUI in C# and have C++ to do the processing?


I used C++ for a GUI program recently. I used the wxWidgets library.
wxWidgets is portable across Linux, Mac OS, MS-Windows. I didn't find
it any more "difficult" than doing GUI in Visual Basic.

If people are saying that GUI development is difficult or problematic
in C++ then it's purely to do with the GUI library they're using.

Here's the program I put together, the webpage explains the libraries
I used and so forth: virjacode DOT com FORWARD SLASH projects FORWARD
SLASH dynamo

(This is the 3rd time I've tried to post this, I dunno if it's not
showing up because I put a link in it, that's why I used DOT and
FORWARD SLASH).
 
W

Werner

+1 to that. It is piece of cake to throw fine looking and portable C++
GUI together using Qt tools. It is not too hard to embed a GUI module
that is made with Qt into existing application that has most GUI made
with MFC.

I can't comment on that. I've often used native windows (win32) for
low level things (mutexes, timers, sockets, serial, threads), but
I've never used it for windows programming, except to receive
windows messages:

::CreateWindow( MSGWINNAME, "", WS_DISABLED, 0, 0, 0, 0, 0x0, 0, 0,
0 );
One (pseudo-)issue that i have encountered is that Qt never destroys
some of its singletons so Visual Studio's debugger reports these as
leaked. It can be silenced by turning the leak-detection temporarily
off when the singletons are allocated. Other issue is that the amount
of tinkering that is needed to embed non-Microsoft tools into VS IDE
is growing from version to version. IDE that is losing ability to
integrate tools? Other, well-known free and open source IDEs may pass
Visual Studio that way.

Yes, I use QtCreator with mingw to setup/compile my project and I
(at this moment) enjoy editing in Eclipse.
C++/CLI don't look at, it is very sad monster language.

C++/CLI... What's that? ;-). No, seriously - I can't comment on
something that I've never even remotely looked at. If I would
consider another language, it would be Java, but simply because
I can't seem to buy a PC or notebook (aside from a mac) without
a pre-installed OS anymore (and I regard that "skelm" -
unethical). Apart from that, If I buy software(especially the OS)
I expect it to outlast it's installbase. MS licensing
prohibits this, not? "Skelms!" ;-).

But that is a discussion for a different group/different day...

Regards,

Werner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top