Window Interface in C++

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

Join Date: Mar 2005
Posts: 6
Reputation: mikecoyner is an unknown quantity at this point 
Solved Threads: 0
mikecoyner mikecoyner is offline Offline
Newbie Poster

Window Interface in C++

 
0
  #1
Apr 13th, 2005
i teach a high school c++ course. i would like to use a window for user interface instead of dos console.

could anyone provide me the basic code to display "hello world" in a window?

and if possible a link to the code necessary to use window api for c++ programs.

thank you.
Mike
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,360
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 240
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Window Interface in C++

 
0
  #2
Apr 13th, 2005
>could anyone provide me the basic code to display "hello world" in a window?
Does your compiler offer to do this for you?

http://img175.echo.cx/img175/5527/hello4nk.th.jpg

>and if possible a link to the code necessary to use window api for c++ programs.
Have you checked your compiler's documentation? It should be the first source for what it can do.

Could you tell us which compiler you are using?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,652
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 721
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Window Interface in C++

 
0
  #3
Apr 13th, 2005
>i would like to use a window for user interface instead of dos console.
My first question is "why"? Introducing graphics should be done only after the students have a strong foundation in the core language and standard libraries. Otherwise, they'll find themselves battling C++ as well as whatever graphics API you choose to give them.

Then of course there's the argument that if you don't teach the core skills of programming first, then all your students will be able to do is make pretty windows that do nothing useful. And that's a best case situation. If they get discouraged and quit because they never won the "little" battles on the command line and gained confidence then you won't even see pretty windows that do nothing.

Personally, I think you're trying to do too much, too fast. Especially for a high school course. But if you really want to make learning harder (maybe to weed out anyone who doesn't have a passion for programming) then tell us your compiler and we'll be able to make better suggestions.

Try googling for Allegro or SDL for a generic solution.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,019
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 931
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Window Interface in C++

 
0
  #4
Apr 13th, 2005
Using C++ for Windows GUI programming is mildly complex. Just look over some of the DaniWeb C++ code snippets and judge for yourself. I can imagine that some of your beginning students would be overwhelmed.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 6
Reputation: mikecoyner is an unknown quantity at this point 
Solved Threads: 0
mikecoyner mikecoyner is offline Offline
Newbie Poster

Re: Window Interface in C++

 
0
  #5
Apr 13th, 2005
Originally Posted by Dave Sinkula
>could anyone provide me the basic code to display "hello world" in a window?
Does your compiler offer to do this for you?

http://img175.echo.cx/img175/5527/hello4nk.th.jpg

>and if possible a link to the code necessary to use window api for c++ programs.
Have you checked your compiler's documentation? It should be the first source for what it can do.

Could you tell us which compiler you are using?
Compiler is Visual C++ 6.0
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 6
Reputation: mikecoyner is an unknown quantity at this point 
Solved Threads: 0
mikecoyner mikecoyner is offline Offline
Newbie Poster

Re: Window Interface in C++

 
0
  #6
Apr 13th, 2005
Originally Posted by Narue
>i would like to use a window for user interface instead of dos console.
My first question is "why"? Introducing graphics should be done only after the students have a strong foundation in the core language and standard libraries. Otherwise, they'll find themselves battling C++ as well as whatever graphics API you choose to give them.

Then of course there's the argument that if you don't teach the core skills of programming first, then all your students will be able to do is make pretty windows that do nothing useful. And that's a best case situation. If they get discouraged and quit because they never won the "little" battles on the command line and gained confidence then you won't even see pretty windows that do nothing.

Personally, I think you're trying to do too much, too fast. Especially for a high school course. But if you really want to make learning harder (maybe to weed out anyone who doesn't have a passion for programming) then tell us your compiler and we'll be able to make better suggestions.

Try googling for Allegro or SDL for a generic solution.
All valid points, however, with the length of the course it may be a good alternative lesson to take a break from the grind...HS students need more stimulation than hardcore programmers
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,360
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 240
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Window Interface in C++

 
0
  #7
Apr 13th, 2005
Originally Posted by mikecoyner
Compiler is Visual C++ 6.0
So is that picture.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,652
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 721
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Window Interface in C++

 
0
  #8
Apr 13th, 2005
>HS students need more stimulation than hardcore programmers
Then perhaps you should teach a language better suited for students than C++. Java perhaps, or Python. Both have relatively easy to use graphics APIs available right out of the box. C++ is a hardcore language designed for hardcore programmers.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC