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.

Recommended Answers

All 12 Replies

>>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.

commented: You've discovered the wonderfull world of wxWidgets :) +6

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)

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.

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.

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 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:(

>>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 ) ;

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.

>>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.

>>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.

Thanks again. Well, Its getting late. got to sleep. Good night to people in my time zone

Hi all,

I would never suggest beginners to program considerable GUIs by using MSDN because it may last until the cow comes home as Ancient Dragon already pointed out. Maybe a better and clearer way for creating GUIs is QT 4 (has nice bar graph) or wxWidgets (both free), also suggested by Ancient Dragon and niek_e. There is also Fox toolkit from a Netherlands guy which is completely free. Using one of them you can freely roam between Win and Unix. Then you should also use gcc with codeBlocks or wxdevC++ on Win, or KDE on Unix (as I do).
(Best of all would be Delphi or Kylix;) )
krs,
tesu

I think someone put the winprog tutorial in here, follow it to the tee, it has helped me loads. I'm getting a little better with Windows API, but I am by no means an expert, especially since I'm taking a "break" from coding at the moment. Anyway, goodluck with that, I have found a few other resources I'll try and post in a bit.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.