| | |
how to program GUI in C++?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 4
Reputation:
Solved Threads: 0
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.
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.
>>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.
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.
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)
But you can try the pro-version here (90 day-trial)
•
•
•
•
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)
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.
•
•
Join Date: Jun 2008
Posts: 4
Reputation:
Solved Threads: 0
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.
#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.
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.
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.
>>MessageBox( NULL, TEXT("Welcome", NULL, NULL ) ;
You have a typo. There should be a closing parenthese ) after the word Welcome. like this:
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.
>>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.
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.
![]() |
Similar Threads
- GUI program that stores information of a friend(name,surname,age,favourite artist)in (Java)
- Stuck in GUI (Python)
- GUI Suggestions (C++)
- TURN THIS ASSIGNMENT UserID INTO GUI, CAN YOU HELP ME (Python)
- Small ATM banking program (C++)
- Help with a reservation program! GUI Messed XD (Java)
- How can I have my program wait for input before continuing? (Java)
- GUI advice (C++)
- help with program to convert integers to roman numerals (Java)
Other Threads in the C++ Forum
- Previous Thread: Best way to do this..?
- Next Thread: Creating a Dynamic Library
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






