User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 423,490 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,710 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 562 | Replies: 12
Reply
Join Date: Jun 2008
Posts: 4
Reputation: paulcat is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paulcat paulcat is offline Offline
Newbie Poster

how to program GUI in C++?

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,123
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 929
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: how to program GUI in C++?

  #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.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,776
Reputation: niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all niek_e is a name known to all 
Rep Power: 11
Solved Threads: 185
niek_e's Avatar
niek_e niek_e is offline Offline
Posting Virtuoso

Re: how to program GUI in C++?

  #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)
Want better/more replies to your questions? Wrap your code in [code] [/code] tags!
do NOT pm me for help, in the best case, you'll get ignored
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,123
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 929
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: how to program GUI in C++?

  #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 11:00 am.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: Jun 2008
Posts: 4
Reputation: paulcat is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paulcat paulcat is offline Offline
Newbie Poster

Re: how to program GUI in C++?

  #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  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,123
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 929
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: how to program GUI in C++?

  #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.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: May 2008
Location: Infinite Castle, below Beltline
Posts: 287
Reputation: Prabakar is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 24
Prabakar's Avatar
Prabakar Prabakar is offline Offline
Posting Whiz in Training

Re: how to program GUI in C++?

  #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 2:12 pm.
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,123
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 929
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: how to program GUI in C++?

  #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 ) ;
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: May 2008
Location: Infinite Castle, below Beltline
Posts: 287
Reputation: Prabakar is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 24
Prabakar's Avatar
Prabakar Prabakar is offline Offline
Posting Whiz in Training

Re: how to program GUI in C++?

  #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  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,123
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 38
Solved Threads: 929
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: how to program GUI in C++?

  #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.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 3:58 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC