how to program GUI in C++?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 4
Reputation: paulcat is an unknown quantity at this point 
Solved Threads: 0
paulcat paulcat is offline Offline
Newbie Poster

how to program GUI in C++?

 
0
  #1
Jun 17th, 2008
I've taken C++ courses before but never programmed any GUI applications. Well for this job I was asked to program a GUI for a solar hybrid project that displays information such as battery charge, temperature, etc...sort of like the thing you see in a Prius.

Can anyone give any recommendations on how to tackle this task? The easiest way... I've downloaded Microsoft Visual C++ Express Edition. I want a whole bunch of displays that shows the informations in real time and maybe (optional) include some sort of a bar graph to make it look better.

How hard would that be?

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: how to program GUI in C++?

 
0
  #2
Jun 17th, 2008
>>How hard would that be?
It may take anywhere from a couple days (for experienced programmers) to about a lifetime for beginners. For your compiler you might also want to download free wxWindows. Or if you want to use pure win32 api functions here's a tutorial.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,879
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillicaphobiac

Re: how to program GUI in C++?

 
0
  #3
Jun 17th, 2008
I could be wrong, but to make a graphbar without using additional toolkits (like wxWidgets etc), you would need Visual Studio standard or pro, which aren't free.
But you can try the pro-version here (90 day-trial)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: how to program GUI in C++?

 
0
  #4
Jun 17th, 2008
Originally Posted by niek_e View Post
I could be wrong, but to make a graphbar without using additional toolkits (like wxWidgets etc), you would need Visual Studio standard or pro, which aren't free.
But you can try the pro-version here (90 day-trial)
You are wrong. The Express edition can be used to write windows GUI using win32 api functions. You need the Standard or better $$$ editions to get MFC and the resource editor. I think there are also free resource editors on the net.
Last edited by Ancient Dragon; Jun 17th, 2008 at 12:00 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 4
Reputation: paulcat is an unknown quantity at this point 
Solved Threads: 0
paulcat paulcat is offline Offline
Newbie Poster

Re: how to program GUI in C++?

 
0
  #5
Jun 17th, 2008
I just tried to copy and paste this code:

#include <windows.h>

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Welcome to Win32 Application Development\n", NULL, NULL);

return 0;
}



from a tutorial and run it in Visual C++ Express, and it gave me this message

" error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [42]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast"

Why is that? I mean, it's going to make learning a lot harder for a beginner if I can't even run a tutorial code due to some mysterious reason that's way over my head now.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: how to program GUI in C++?

 
0
  #6
Jun 17th, 2008
You are compiling your program for UNICODE. Turn that feature off. Go to menu Properties --> Project (at the bottom of the menu). Expand Configuration Properties, then click General.

1) Change the Configuration: at the top of the window to All Configurations

2) In the right pain near the bottom you will see Character Set. Select Not Set from the combo box.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 334
Reputation: Prabakar is on a distinguished road 
Solved Threads: 29
Prabakar's Avatar
Prabakar Prabakar is offline Offline
Posting Whiz

Re: how to program GUI in C++?

 
0
  #7
Jun 17th, 2008
I cant explain much cause i am very new to win32 programs and then try this,

MessageBox( NULL, TEXT("Welcome"), NULL, NULL ) ;

EDIT: I should not have talked about something which I don't know
Last edited by Prabakar; Jun 17th, 2008 at 3:12 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: how to program GUI in C++?

 
0
  #8
Jun 17th, 2008
>>MessageBox( NULL, TEXT("Welcome", NULL, NULL ) ;

You have a typo. There should be a closing parenthese ) after the word Welcome. like this:
MessageBox( NULL, TEXT("Welcome"), NULL, NULL ) ;
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 334
Reputation: Prabakar is on a distinguished road 
Solved Threads: 29
Prabakar's Avatar
Prabakar Prabakar is offline Offline
Posting Whiz

Re: how to program GUI in C++?

 
0
  #9
Jun 17th, 2008
Ya I noticed it. You are not blaming me for anything else. Does that mean I am right?.

As I said before, I am new to win32. Till I registered in this forum the only world I knew was Turbo C.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,442
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1474
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: how to program GUI in C++?

 
0
  #10
Jun 17th, 2008
>>You are not blaming me for anything else. Does that mean I am right?.
No, it just means that line had a typ. To check if you are right or wrong you have to compile and run the program.

>>ill I registered in this forum the only world I knew was Turbo C.
Great move I'm sure you won't regret the move.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC