C going to C++

K

Kevin Torr

I've been using C for some time now and I would like to take my first leap
into C++. I should warn you that I have little or no experience with visual
C++, though I do have some experience with different OOP languages.

I am using Microsoft Visual C++ 6.0.

I would like to create a very simple program to begin with:

A dialog box, say 320x240 in size, with file->exit and help->about menus.
Inside the box will be an input field where you type in your number, and a
button that says 'Go'.
Under that will be another text field which will give you 2* what you typed
previously if it's a number, otherwise it pops up with an error box saying
"Please enter only integers and decimals into the box".

So this is what I have done so far:
Created a new "Win32 application" project called "thetest".
I then create a new "C++ Source File" called "thesource" and add it to the
workspace "thetest".
I go up to 'insert -> resource -> menu' and create the menu
I save the resource as 'menu.rc' and 'menu.rc' to the 'Resource Files'
folder in the 'File View'

This is about as far as I can get without a tutorial or instructions to get
me further.
I'm not sure how to access the resources I have included to the project from
the C++ source file.

If someone could followup with either instructions or a URL that can run me
through this step-by-step, it would be very handy. Thanks.

Also, How do I remove files/resources from my workspace? There is no
'delete' item in the right-click menu!

Thanks.
 
S

Steven T. Hatton

Kevin said:
I've been using C for some time now and I would like to take my first leap
into C++. I should warn you that I have little or no experience with
visual C++, though I do have some experience with different OOP languages.

I am using Microsoft Visual C++ 6.0.

I would like to create a very simple program to begin with:

A dialog box, say 320x240 in size, with file->exit and help->about menus.
Inside the box will be an input field where you type in your number, and a
button that says 'Go'.
Under that will be another text field which will give you 2* what you
typed previously if it's a number, otherwise it pops up with an error box
saying "Please enter only integers and decimals into the box".

So this is what I have done so far:
Created a new "Win32 application" project called "thetest".
I then create a new "C++ Source File" called "thesource" and add it to the
workspace "thetest".
I go up to 'insert -> resource -> menu' and create the menu
I save the resource as 'menu.rc' and 'menu.rc' to the 'Resource Files'
folder in the 'File View'

This is about as far as I can get without a tutorial or instructions to
get me further.
I'm not sure how to access the resources I have included to the project
from the C++ source file.

If someone could followup with either instructions or a URL that can run
me through this step-by-step, it would be very handy. Thanks.

Also, How do I remove files/resources from my workspace? There is no
'delete' item in the right-click menu!

Thanks.

Detailed discussions of the use of any particular IDE are taboo in this
newsgroup. There's a very helpful FAQ which you would do well to read.
People tend to be pretty tough about sticking to the guidelines discussed
therein. If you have C++ related questions, this is a good place to ask
them. If you have VC++ related questions, I believe you can find links to
resources in the FAQ. If you have questions of a newbie nature, try to
find the answer in the FAQ, if the FAQ isn't clear, or doesn't address the
question, then post the question. Here's the FAQ:

http://www.parashift.com/c++-faq-lite/

There's also a learning C++ newsgroup listed somewhere on Stroustrup's site.
http://www.research.att.com/~bs/C++.html

My experience has been that trying to learn C++ the easy way doesn't work.
I.e., you won't get there by clicking icons, and menu selections in an IDE.
There are some books listed in the FAQ. Consider getting one or three.
You may do well to poke around on Microsoft's developer's site as well. I,
personally, don't do Windoze, but I do know they have some good resources.
My advice is to stay away from anything IDE specific until you get grounded
in C++.
 
J

John Harrison

Kevin Torr said:
I've been using C for some time now and I would like to take my first leap
into C++. I should warn you that I have little or no experience with visual
C++, though I do have some experience with different OOP languages.

So far so good.
I am using Microsoft Visual C++ 6.0.

Not very relavent to learning C++.
I would like to create a very simple program to begin with:

Good.

A dialog box, say 320x240 in size, with file->exit and help->about menus.
Inside the box will be an input field where you type in your number, and a
button that says 'Go'.

C++ has no dialog boxes, or menus or buttons.
Under that will be another text field which will give you 2* what you typed
previously if it's a number, otherwise it pops up with an error box saying
"Please enter only integers and decimals into the box".

So this is what I have done so far:
Created a new "Win32 application" project called "thetest".
I then create a new "C++ Source File" called "thesource" and add it to the
workspace "thetest".
I go up to 'insert -> resource -> menu' and create the menu
I save the resource as 'menu.rc' and 'menu.rc' to the 'Resource Files'
folder in the 'File View'

This is about as far as I can get without a tutorial or instructions to get
me further.
I'm not sure how to access the resources I have included to the project from
the C++ source file.

If someone could followup with either instructions or a URL that can run me
through this step-by-step, it would be very handy. Thanks.

Also, How do I remove files/resources from my workspace? There is no
'delete' item in the right-click menu!


You seem confused between C++ and Visual C++. Visual C++ is a development
environment and your questions are all about how to use that tool. As such
they have no relevance on a group about the C++ language (or C language
either).

Learning C++ is learning a new language, if that is what you want to do then
fine, ask your C++ questions here. On the other hand learning how to program
Windows or how to use Visual C++ does not require that you learn C++ (Visual
C++ is a perfectly good C compiler).

Try for help with the Visual C++
development tool (you can find this on Microsoft's news server
news.Microsoft.com if your server doesn't carry it). Try
for Windows programming questions.

john
 
K

Kevin Torr

John Harrison said:
You seem confused between C++ and Visual C++. Visual C++ is a development
environment and your questions are all about how to use that tool. As such
they have no relevance on a group about the C++ language (or C language
either).
Learning C++ is learning a new language, if that is what you want to do then
fine, ask your C++ questions here. On the other hand learning how to program
Windows or how to use Visual C++ does not require that you learn C++ (Visual
C++ is a perfectly good C compiler).
Try for help with the Visual C++
development tool (you can find this on Microsoft's news server
news.Microsoft.com if your server doesn't carry it). Try
news:comp.os.ms-windows.programmer.win for Windows programming questions.

I understand what you're saying.

Where can I find a tutorial that will show me the steps in writing a C++
program that will perform my task, or at least something visually similar?

A box with an input, an output field, and a button that runs the function.
 
F

Frane Roje

Ok, I suggest you start with console applications in C++,
and after you have conqured that you can move onto win32 apps.

If you want to learn about win32 apps you should get a newbie book
Programming for Windows by Charles Petzold

And finnaly you should ask your questions about win32 apps on the
newsgroup that John Harrison posted
 
J

John Harrison

I understand what you're saying.

Where can I find a tutorial that will show me the steps in writing a C++
program that will perform my task, or at least something visually similar?

A box with an input, an output field, and a button that runs the function.

I'm not sure you do. You seem to be linking to things that are separate,
learning C++ and learning Windows programming.

For a tutorial on Windows programming try the Microsoft MSDN site.

I'm not aware of any online tutorials in C++ that are worth reading.

john
 
S

Steven T. Hatton

Kevin said:
Where can I find a tutorial that will show me the steps in writing a C++
program that will perform my task, or at least something visually similar?

A box with an input, an output field, and a button that runs the function.

This is actually an issue some of the C++ architects have some sensitivity
to. They understand that commandline programming seems mundane and
antiquated to people new to the language. There's been some discussion of
including a basic windowing library in the Standard, or in the collection
of libraries on the periphery. The latter seems far more reasonable than
the former. But neither exist.

I will *highly* recommend the learning materials found in the Qt
documentation. You can get Qt free for Win32, or better.

http://www.trolltech.com

http://doc.trolltech.com/3.3/index.html
 
C

Chris Fogelklou

Kevin Torr said:
questions.

I understand what you're saying.

Where can I find a tutorial that will show me the steps in writing a C++
program that will perform my task, or at least something visually similar?

A box with an input, an output field, and a button that runs the function.

Also check out wxWindows, a cross platform C++ GUI library that can be
compiled in MSVC, GCC, mingw, or any other compiler for many platforms.

It has plenty of good examples to walk through, compiles natively on your
chosen platform, and lets you focus on the C++ coding rather than the
graphics.

Cheers, Chris
 
P

Pete

Steven T. Hatton wrote:
I will *highly* recommend the learning materials found in the Qt
documentation. You can get Qt free for Win32, or better.

http://www.trolltech.com

http://doc.trolltech.com/3.3/index.html

I will *highly* recommend you stay away from Qt and use the real Windows API
instead.
Qt's licensing is horrible. Yes, you can get it free, but once you want to
do something useful with your program it costs around several thousand
dollars.
It also includes a bunch of non-standard C++ language features.

If you want to use a glossy wrapper around the real & elegant Win32 API, use
something with good licensing terms such as WTL.

- Pete
 
R

richard.forrest1

Also check out wxWindows, a cross platform C++ GUI library that can be
compiled in MSVC, GCC, mingw, or any other compiler for many platforms.

It has plenty of good examples to walk through, compiles natively on your
chosen platform, and lets you focus on the C++ coding rather than the
graphics.

wxWindows has recently changed its name to wxWidgets after a request from
Microsoft.

That aside, it is an excellent GUI library for cross-platform work, as all
work should be ;-)
It is also opensource and may be downloaded from www.wxwidgets.com

Richard
 
S

Steven T. Hatton

Pete said:
Steven T. Hatton wrote:


I will *highly* recommend you stay away from Qt and use the real Windows
API instead.
Qt's licensing is horrible. Yes, you can get it free, but once you want to
do something useful with your program it costs around several thousand
dollars.

That's interesting. I'm using a Qt based application as my usenet client,
and the license is free. AAMOF, my entire desktop is Qt based, and free.
Oh, you want to /sell/ your product, and not /pay/ TrollTech! Well....
It also includes a bunch of non-standard C++ language features.

There is nothing in Qt that isn't standard C++. That is, there is no
language feature used in Qt that is not specified in the Standard. Perhaps
you mean moc? It's standard preprocessor metaprogramming.

But the really nice thing is, you don't even need to use Windows.
 
C

Claudio Puviani

Kevin Torr said:
I've been using C for some time now and I would
like to take my first leap into C++. I should warn
you that I have little or no experience with visual
C++, though I do have some experience with different
OOP languages.

I am using Microsoft Visual C++ 6.0.

I would like to create a very simple program to
begin with:

A dialog box, say 320x240 in size, with file->exit and
help->about menus.
[rest snipped]

This isn't going to help you learn C++ any more than getting thrown in a
crate and shipped to Wisconsin will help you learn how to fly a plane.
You'll be spending all your energy trying to figure out the aspects of
programming the graphical interface and practically none learning anything
meaningful about C++.

As boring as it may seem, you'll learn far more by avoiding GUIs, databases,
and other platform-specific distractions and by modeling various problems
using the core C++ language and libraries. Once you're comfortable with
that, it will be a lot easier to expand into other territories.

Claudio Puviani
 
P

Pete

Steven said:
Pete wrote:

That's interesting. I'm using a Qt based application as my usenet
client, and the license is free. AAMOF, my entire desktop is Qt
based, and free. Oh, you want to /sell/ your product, and not /pay/
TrollTech! Well....

No. If I had a bunch of Qt apps and needed to sell them, I'd pay.
But IMO when better and free tools (WTL) are availible, I'd rather not pay.
There is nothing in Qt that isn't standard C++. That is, there is no
language feature used in Qt that is not specified in the Standard.
Perhaps you mean moc? It's standard preprocessor metaprogramming.

Signals, slots, and other junk.
But the really nice thing is, you don't even need to use Windows.

I don't really care about that. There's no OS other than Windows (desktop
and CE) that my target audience uses, so it would be a bad move to not use
the native toolkit.

- Pete
 
S

Steven T. Hatton

Signals, slots, and other junk.

They are merely shorthand for code produced by moc. You can read the code,
and it is all standard C++. I'm not going to go into this any further.
It's not proper for me to speak for TrollTech, nor is it proper for you to
deride their product in a forum such as this where it is not appropriate
for them to defend their product. You can go elsewhere and hash it out,
but I don't think I'll follow.
I don't really care about that. There's no OS other than Windows (desktop
and CE) that my target audience uses, so it would be a bad move to not use
the native toolkit.

Fine. That's your business. I wasn't offering the advice to you.
 
R

Rui Maciel

Also check out wxWindows, a cross platform C++ GUI library that can be
compiled in MSVC, GCC, mingw, or any other compiler for many platforms.
<snip>

wxWindows is now called wxWidgets (http://www.wxwidgets.org/)

The name was changed due to some trademark issue raised by Microsoft. If
you are interested in the official explanation, please check out
http://www.wxwidgets.org/name.htm


P.S.: I believe that the library has great potencial and that the new
name is better than the previous one. But that's jus me.
 
P

Pete

Steven said:
They are merely shorthand for code produced by moc. You can read the
code, and it is all standard C++.

Then why not use real C++ in the first place? It's not hard to have similar
mechinisms.
I'm not going to go into this any
further. It's not proper for me to speak for TrollTech, nor is it
proper for you to deride their product in a forum such as this where
it is not appropriate for them to defend their product. You can go
elsewhere and hash it out, but I don't think I'll follow.

Sorry I came across as deriding their product, that wasn't my intention.
I was just expressing dislike for Qt, in the same manner you have expressed
dislike of Windows. Remember, MS reps don't come here either.
Fine. That's your business. I wasn't offering the advice to you.

Good point. Maybe I should suggest wxWidgets instead of WTL, to be PC.

IMVHO, though, unless you're specifically targetting a niche market that
uses OSs like Linux, I feel it's better to use a toolkit like WTL that is
made from the ground up for the OS that 90% of the general computer users
use.

Also, IIRC WTL is open source also, though.

- Pete
 
L

Leor Zolman

Then why not use real C++ in the first place? It's not hard to have similar
mechinisms.

Pete, isn't that a bit like saying that using the Boost libs, or Andrei
Alexandrescu's Loki facilities, isn't using "real C++", and we ought to
just write our own implementations from scratch because it "isn't hard"?
-leor
 
P

Pete

Leor said:
Pete, isn't that a bit like saying that using the Boost libs, or
Andrei Alexandrescu's Loki facilities, isn't using "real C++", and we
ought to just write our own implementations from scratch because it
"isn't hard"? -leor

No, Qt uses some sort of preprocessor so you can have "slot" functions and
other stuff.
Boost is written in pure C++ AFAIK.

- Pete
 
L

Leor Zolman

No, Qt uses some sort of preprocessor so you can have "slot" functions and
other stuff.
Boost is written in pure C++ AFAIK.

Well, all I had to go on (since I've never even heard of "Qt" before this
thread) was what Steven T. Hatton wrote, that "it is all standard C++". As
we've learned around here, Steven is never wrong.
-leor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Compilers c c++ 3
Help me, going live with a quiz 0
C++, SFML, SDL2 - 2D game 0
Coding going wrong 1
Boomer trying to learn coding in C and C++ 6
Become a C++ programmer 6
C++ database 0
C exercise 1

Members online

No members online now.

Forum statistics

Threads
474,171
Messages
2,570,935
Members
47,472
Latest member
KarissaBor

Latest Threads

Top