C++ help

He has: 1,380 posts

Joined: Feb 2002

hey! i'm writing my first C++ Program...i was doing alright until i ran into this problem:

basically, i will have a simple GUI with multiple input fields...i have no idea how to create the GUI...but anyways, how do i interface the GUI with my variables?? would i just go ahead and do

cin >> a;
cin >> b;
cin >> c;
' with all my variables that i need to have input-ed? but i think this would cause some problems...i might be wrong...

if you could explain how the GUI interfaces and what i should do with the variables that are input-ed, and how to create a GUI (or link to tutorial...i googled...so confusing) that would be great...thanks!

maybe i'm talking about user-interface...or are they the same thing? i am so confused...

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

For your first C/C++ program, I would recommend you start by making DOS applications. Much, much easier IMO.

I've taken two C/C++ courses, neither got anywhere close to GUI. I only kept one book, and I don't like it much. It's "How To Program C++" by "Deitel & Deitel", published by Prentice Hall. When I get back to it, I'll prolly look for a book published by Osborne or IDG.

I've only made one attempt at a GUI C++ app, and I did it with MFC (Microsoft Foundation Class). And what's cool is that it works. Smiling It's only a form with 8 buttons and a menu consisting of File and Help, but heck, it's still a GUI.

I've heard that it's easier to make your own functions for drawning the GUI (compared to MFC). But having MSDN, I had more resources about how to use MFC than how to write my own functions.

As far as getting input. cin/cout (I believe) is only for console input/output.

What invironment are you using to write your app? (MS VC++?, borland?)

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 1,380 posts

Joined: Feb 2002

oh yea...its in DOS, you know those blue screen progs in like doctors offices and stuff? thats what i'm sorta aiming for...i was just wondering how to get that user-interface...

i'm just using Notepad to write it...

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Oh, that kinda GUI. I immediately thought Windows.

Come to think of it, neither class even taught us to print colored text. Doh!

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

He has: 1,380 posts

Joined: Feb 2002

isnt that the same link you gave me in the other post? lol

the thing is, i've googled and stuff...cant find anything on this low of a level..its all superhigh level stuff...

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Super high level, eh?
Would you like some assembly code instead?

Q10CLEAR    PROC    NEAR
            PUSHA                       ;Preserve general registers
           
            MOV     AX,0600H            ;Scroll whole screen
            MOV     BH,17H              ;White on blue
            MOV     CX,0000             ;Full screen
            MOV     DX,184FH            ;
            INT     10H                 ;Clear it up
           
            POPA                        ;Restore registers
            RET
Q10CLEAR    ENDP
'

Mark Hensler
If there is no answer on Google, then there is no question.

He has: 1,380 posts

Joined: Feb 2002

haha...thanks!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.