C++ programming migration from DOS to Windows

C++ programming migration from DOS to Windows

Post by cat_dog_as » Thu, 03 Mar 2005 19:40:36

I am used to programming in DOS mode via Borland C++. I would now like
to create programs for the Windows envirinment. Is it absoultely
necessary to use Visual C++ to do this? Are there other tools that can
help me in doing Windows programming via C++? How am I going to create
drop-down menus and allow my programs to interact with the mouse?


C++ programming migration from DOS to Windows

Post by EventHelix » Thu, 03 Mar 2005 20:30:11

Visual C++ would still be your best bet for Windows application
It is a well developed platform with lots of support available on or
off the internet.



C++ programming migration from DOS to Windows

Post by Thomas Mat » Thu, 03 Mar 2005 22:22:58

Borland C++ Builder would still be your best bet for Windows
application programming. It is a well developed platform with
lots of support available on and off the internet.

The GNU C++ compiler along with a windowing framework,
such as TK/TQ, and wxWidgets is a well developed and free
platform for windows application programming. There is
not as much support, but then it is free unlike Microsoft
and Borland, which require money for their support (depending
on the need or degree).

There are other compilers and platforms. The "best" for
Windows development is a decision that the OP must make
depending on the OP's needs and abilities.

Thomas Matthews

C++ newsgroup welcome message:
http://www.yqcomputer.com/ ~shiva/welcome.txt
C++ Faq: http://www.yqcomputer.com/ ++-faq-lite
C Faq: http://www.yqcomputer.com/ ~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
Other sites:
http://www.yqcomputer.com/ -- C++ STL Library book

C++ programming migration from DOS to Windows

Post by skeptica » Thu, 03 Mar 2005 22:41:52

On 2 Mar 2005 03:30:11 -0800, "EventHelix.com" < XXXX@XXXXX.COM >

The guy said he originally programmed with Borland. Borland has its
own version of visual C++, C# and Java.

The fact is M$ is overrated.

(But hopefully Borland has no visual basic. There ought to be a

C++ programming migration from DOS to Windows

Post by skeptica » Thu, 03 Mar 2005 22:56:18

On Wed, 02 Mar 2005 13:22:58 GMT, Thomas Matthews

Yeah I can just imagine building C++ foundation class dlls, ActiveX
and serialized MDI apps under that shitbox platform.

Umm, let's see. VC++ 6.0 or .NET is less than $100 for standard. Same
with Borland.

If you don't have that chump change go rob somebody...

C++ programming migration from DOS to Windows

Post by Ioannis Vr » Fri, 04 Mar 2005 03:21:33

Actually as things are so far, it looks like it is discontinued
(unfortunately). Now they provide Delphi .NET and C#, all under one
package named "Delphi".

If you have enough bandwidth you can download the Delphi 2005 trial to
have a look.

You may also check this thread:

http://www.yqcomputer.com/ %40posting.google.com&rnum=1&prev=/groups%3Fq%3Dg:thl3624390777d%26dq%3D%26hl%3Del%26lr%3D%26selm%3Dd983e0c.0412030448.74dd402f%2540posting.google.com

Apart from portable GUIs, what makes sense to invest time for learning
Windows programming is .NET.

The only available IDE supporting .NET is VC++ 2003, however they
provide the compiler (visual studio 2003 toolkit) as a free download.

However since there is the upcoming C++/CLI (due to March) and VS 2005
(due to end of summer), the best approach for someone who is not in an
emergency to learn Windows programming today, is to wait for the 2005
release and invest his time learning some more ISO C++ until then.

Ioannis Vranos


C++ programming migration from DOS to Windows

Post by Jerry Coff » Fri, 04 Mar 2005 03:23:45

at_dog_ass wrote:

First of all, you'd be much better off asking about this someplace like
comp.os.ms-windows.programmer.win32. There the question is topical, and
a much higher percentage of the participants actually have at least
some clue about the subject matter.

With that said, I hope I'll be forgiven a rather long post that's
mostly only marginally topical. Anybody who's only interested in
topical posts might as well move to the next post now...

No, Visual C++ isn't anywhere close to the only available option.
Depending on your situation, one of the alternatives might be better.

In the last few years, MS has worked very hard on upgrading their
compiler, so the current compiler is quite competitive WRT to
conforming with the C++ standard. OTOH, most of their competition has
been doing the same, the only obvious exception being Comeau, whose
conformance a few years ago was already better than anybody else is
really even trying to accomplish today. MS produces pretty decent
output code as a rule, seeming, in particular, to attempt to provide a
decent balance between size and speed of output.

Borland is still in the market to some extent. As has been the case
nearly forever, their compiler runs fast, but produces relatively poor
code. It has reasonable language conformance, but nothing to get
particular excited about (that's code for "the worst of a good crowd.")

There are a couple of ports of gcc to Windows (cygwin and mingw). IMO,
they're utterly worthless -- they run slowly and typically produce
ridiculously huge executables. Output speed varies over a wide range:
the fastest available for some input code, but other times in close
competition with Borland for the slowest code you can get. I've
frequently seen VC++ produce and executable that was one quarter the
size and 30% faster than gcc did for the same source code. Community
support for gcc on Windows is nearly nonexistent -- most gcc-oriented
newsgroups are oriented primarily toward Linux, and most
Windows-oriented newsgroups assume you use Microsoft. The few people
I've seen who attempt to give advice on using cygwin or mingw seem
mostly lost themselves.

Comeau is more or less unique: the best language conformance you can
get, superb error messages (a feature that's rarely mentioned but
_extremely_ useful, IMO) and no ability to produce machine code itself,
so you have to use it along with some other compiler. Code output
varies with the back-end compiler, but at least part of the time, the
combination does considerably better than the back-end compiler can on
its own.

Intel C++ is probably second only to Comeau for language conformance.
As you'd expect from Intel, its output is typically faster than
anything else available, at least on an Intel chip (its output also
runs on AMD chips, but rarely does so well on them). The penalty for
all this optimization is that the compiler runs quite slowly.

I haven't used Code Warrior recently enough to comment on it much. The
last time I used it, it seemed competitive with Intel for language
conformance, and about on a par with VC++ for compile speed and quality
of output code, but that was quite a while ago.

IDEs: Microsoft and Borland have both produced decent IDEs in the past,
but the current iterations of both are utterly unusable. Borland's IDE
is the least stable program I'd used in at least a decade. Microsoft's
is more dependable, but it's just dependably lo

C++ programming migration from DOS to Windows

Post by Ioannis Vr » Fri, 04 Mar 2005 03:47:00

Which VC++ version do you have in mind?

Based on the

?! VS 6 had no designer at all. What did you like in VS 6? The
maximize/minimize buttons look about the same with the current release. :-)

Ioannis Vranos


C++ programming migration from DOS to Windows

Post by Jerry Coff » Fri, 04 Mar 2005 06:17:21


I can't really comment until/unless I understand what you're talking
about. If the conversation is going to be very extended, we should
certainly move it elsewhere...

The fact that it worked. You could do things quickly and efficiently.
Just to give an example, if I'm looking at a posting with some code in
it and want to compile it, in VS 6 I click on the "new file" button,
paste in the code, click on the "compile button", and it automatically
creates a project for me, prompts me to save the file, and then
compiles the code.

In VS 7, the equivalent of clicking the "new file" button is:
click on "File"
click on "New"
click on "File..."
click on "Visual C++" in the left column
click on "C++ file" in the right column
click on "Open"

All this just to create a blank file! As I recall, convincing the silly
thing to _compile_ the file afterwards is even more difficult (you
can't just click the compile button at all -- you have to do something
like saving the file yourself, then manually create an empty project,
then add that file back into it, or something on that order, but
frankly I'm too lazy to spend the next half-hour working on it just so
I can post what the 17 steps necessary to make it happen.

As far as I can see, the only button in the VS 7 IDE that matters at
all is the close button!

The universe is a figment of its own imagination.

C++ programming migration from DOS to Windows

Post by alfp » Fri, 04 Mar 2005 06:17:45

* Ioannis Vranos:

One big difference was that DevStudio 6 did not corrupt your source code or
your image resources or your project files, and in general, was not
designed by the Office Assistant "you need some help, obviously" team.

Regarding the original question, that's a partial yes: AFAIK only Visual C++
supports GDI+, or put another way, the GDI+ C++ interface is made to
incompatible with C++ so you need the Visual C++ "language" :-).

A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

C++ programming migration from DOS to Windows

Post by Ioannis Vr » Fri, 04 Mar 2005 07:03:41

VC++ 2003 has a RAD, you know, drag and drop components on a form...

> The fact that it worked. You could do things quickly and efficiently.

Yes the IDE is not suitable for hello world programs (= to learn ISO C++
on it) as 6 was. But on the other hand, 6 is completely broken regarding
ISO C++ conformance since it is old.

For this kind of stuff, you should probably use a text editor like
context and configure it to run the VC++ compiler.

7 was completely lame for .NET programming, since it lacked the
designer. 7.1 shares the same designer with VC# and VB producing C++
code automatically, as the current beta of 2005 (but in 2005 the
components are more nice, flashy or something - .NET 2 styles I suppose).

Ioannis Vranos


C++ programming migration from DOS to Windows

Post by Jerry Coff » Fri, 04 Mar 2005 09:14:40

oannis Vranos wrote:

I see. And you believe VS 6 didn't do this?

[ ... ]

VC++ 7.x is _bad_ for small programs, but becomes even _worse_ on
larger ones.

This is true -- I'm pretty sure I pointed out that the compilers was
upgraded drastically. So far, the combination that gives reasonable
usability and decent conformance is VS 6 with the Intel compiler.

I disagree -- what I should use is a decently designed IDE. There's
simply no excuse for turning something as simple as creating a file
into a 20-minute ordeal.


7 was completely lame (with no qualifications needed). 7.1 certainly
has a better compiler, but the IDE is virtually unchanged.

As far as designing forms goes, VS 6 worked perfectly well, and still
does for that matter. If you're doing something that doesn't fit so
well as a "form" VS 6 also works well, but VS 7.x becomes excruciating.

Just for one example of true stupidity in VS 7.1: you create a typical
MFC application. You want to override OnDraw to draw something in your
window. You have to start by rummaging through its lists of stuff until
you find that it considers OnDraw an Overridable. Then to override it,
you can't just double OnDraw in the list or something like that -- no,
you have to enter the name of the function you're going to overrid it
with. It knows ahead of time that this name _must_ be OnDraw, but you
still have to enter than into a text box anyway.

Then, let's assume that being slightly less than perfect, you override
a function you later find out you didn't really want to override
afterall. You go to try to remove your override. You start by going to
the box where you had to enter its name, and try to delete the name.
For your trouble, you get a message saying "The Message Handler Name
Cannot be Changed".

I'm not ever sure they provide a way to remove an override -- if there
is, I gave up and went back to VS 6 before I found it.

So, it has a text box, but you can only ever use it to enter one
specific piece of text. If you enter text in the wrong box, it not only
doesn't help you to fix your mistake, but does its best to prevent you
from doing so either.

I'd better stop, or the people who've never used it will start to
believe that I must just be making this all up -- that _nobody_ could
seriously have released such a user-hostile piece of garbage. Well, I'm
sorry to say it, but it really is all true.

The universe is a figment of its own imagination.


C++ programming migration from DOS to Windows

Post by Greg » Fri, 04 Mar 2005 11:33:42


All you have to do is Ctrl+N and ENTER. And unlike VC6, the editor knows at
this point that you are editing a .cpp or .h file, and does appropriate
syntax highlighting.


C++ programming migration from DOS to Windows

Post by Lionel » Fri, 04 Mar 2005 18:11:23

I think you're being a bit harsh on gcc here. I use the Cygwin port of
gcc for routine programming work in Windows. In particular, over the
last few releases it appears to have improved markedly in terms of code
speed/size optimisation and standards compliance. I can't speak for VC7
(which is not available on my system) but compared with VC6 my gcc
executables are generally somewhat (but not drastically) larger and
significantly faster. [In fact I cannot compile most of my code on VC6,
mainly because of its horribly broken template handling].

Community support for gcc (and Cygwin) is IMO excellent - it doesn't
necessarily have to be "on Windows", since gcc is remarkably consistent
across platforms. If you're doing GUI programming you'll probably be
using either the "raw" Windows API - which is not compiler-specific - or
perhaps another application framework which will presumably have its own
support (you won't - thankfully - be using the horrendous MFC).

A further point: if cross-platform portability is an issue (it is for
me), gcc is by far your best (if not only) option.

Lionel B

C++ programming migration from DOS to Windows

Post by Jerry Coff » Sat, 05 Mar 2005 11:30:15

oannis Vranos wrote:

[ ... ]

Perhaps you should learn what you're talking about before making such
definite statements.

In VS6 if you want "RAD", you create an MFC application, and select
"CFormView" as the parent class for your view. You then plop down
buttons, edit controls, etc. Attaching code is virtually identical to
doing it in 7.1. For example, attaching code to a button in 7.1
requires double-clicking the button, where 6.0 requires a ctrl-double
click instead. If you're honestly suggesting that pressing or not
pressing the control key while double-clicking is the difference
between RAD and not, so be it, but if that's honestly what RAD means, I
have to admit it's even stupider than I always thought.

[ ... ]

7.0 had the same sort of crap, just for VB, C# and such. In 7.1 they
added it for their corruption of C++, but the IDE itself doesn't strike
me as significantly different. OTOH, I have to admit that I found both
sufficiently bad that I quit using them fairly quickly, so there may be
differences in the details that I've never gotten around to finding.


I'll refrain from an (even further off-topic) rant on the defects in

How in the world does this strike you as easier than MFC? For MFC, I
put the button on a form, do a control-double-click, and it creates a
skeleton handler for the button being pressed, and puts my cursor right
about where I'm likely to want to add some code to do something when
the button is pressed.

It sounds to me like you've used VS 6/MFC very little (if at all).

[ ... ]

It's excessively complex, and bears only a superficial and misleading
resemblence to C++.

You guess wrong. You _can_ explicitly specify sizes and positions of
controls if you _want_ to with MFC, but if you're designing a form,
there's rarely much reason to do so. I'm pretty sure I don't remember
the last time I did such a thing anyway.

[ ... ]

I'm not talking about in my code. I'm talking about in the IDE,
specifically in its "properties" window. It has all the "overridables"
for your form. If you want to override one, you have to put in the name
of the overriding function -- but this has to precisely match the name
of the function being overridden, so you can only ever enter one piece
of text there.

To their (minimal) credit, they do include a drop-down that lets you
select "add <function_name>" and it enters the text for you. While
better than nothing, this is still exceptionally poor GUI design --
first of all, what it holds isn't really a piece of data, but something
that acts like a button. Second, it's wasteful -- the space taken by
the drop-down list could easily hold the buttons directly. Third, it's
inefficient -- to add the item, you either type in its name (perfectly)
or else click the drop-down, then select the "add <whatever>" item (at
that point, the only item in the list) and finally get to start editing
your code.

Also looking more carefully, once you've added the handler, it turns
out there IS a way to remove it -- but you can't do it directly -- you
have to select the "delete" item from the drop-down list.

I'm reasonably certain the person who did this did NOT really think
about using it. Rather, s/he had this cool list that held actions
instead of data, and decide to use it, mostly just because it was new
where buttons were old and boring (and functional).

The universe is a figment of its own im