cat_dog_ass wrote:
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?
First of all, you'd be much better off asking about this someplace like
comp.os.ms-windows.program mer.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 lousy. Based on the
current pre-release, the next iteration of MS's IDE is a _drastic_
improvement, though still (IMO) inferior to VS 6.0. Intel doesn't have
an IDE of their own, but their compiler can be used with recent MS
IDEs.
There are a couple of free IDEs available for gcc -- the best known is
probably Dev-C++ from bloodshed.net. At least the last time I tested
this, it failed what I consider the bare minimum of usability
requirements -- e.g. it doesn't support regular expressions for search
and replace. OTOH, there are a fair number of people who consider it
excellent, and you might easily like it a lot. It does strike me as
bearing a strong resemblence to Borland's IDEs.
TTBOMK, Comeau is currently usable only from the command line. Code
Warrior includes an IDE, but it's probably changed since I used it last
(though from what I recall, it struck me as reasonable).
Prices: contrary to popular belief, both Borland and VC++ can be
downloaded for free, minus the IDEs -- which are so worthless they're
no loss anyway. If you really want the VC++ IDE, you can get the
"Standard" version for <$100US. The compiler it includes is a
stripped-down version with no optimization, but you can then use it
with the freely-downloaded compiler (which _does_ have optimization) to
get nearly the equivalent of the full "Profession al" version for a
fraction of the cost. The Windows version of Comeau (like most other
versions) is only $50 -- an outright bargain, given its quality. The
gcc ports manage the trick of being "free" yet simultaneously the most
expensive compilers you can get.
I won't try to go into how mouse handling and such is done under
Windows -- but I'd advise picking up a copy of _Programming Windows_,
which spends a few hundred pages explaining it quite well. For now,
suffice it to say that the basic orientation of the program is enough
different that it's probably going to take some serious adjustment to
get used to it.
--
Later,
Jerry.
The universe is a figment of its own imagination.