I have a quick question to all you programmers that have played around with variant versions of C++. I know there is alot of them now, and I never really tried anyone of them. (Well many moons ago I once used Borland's Turbo C). I was thinking i might try C/C++ again, but it must have a few *qualities* before I bother, so i thought i would ask if anyone knows of a version that would fit the bill..

1) Licience Free would be nice, I dont program as a profession and hence dont really want to fork over hundresd of $$.
2) Compiled OBJ files are compatible with MASMS obj's (or at least a tool to convert either is available)
3) Has some level of OOP management, and if not directly able to work with COM objects, it should be able to have a set of macros designed to do such...

Anyways, if you think you've ran across a variant form of C/C++ that can closely fit this bill i would be interested in you suggestion.
Posted on 2003-11-01 09:53:05 by NaN
I would choose C++ for it's OO support, nowadays C is mostly used in driver development and in embedded systems (pda, phone apps). For serious applications C++ is used most of the time.
About the variants, there is a standard (ANSI C++). Just learn that and you should be able to use any compiler. Then there's the STL (Standard Template Library), a standard set of templates for file/console I/O, several types of containers (lists, maps, vectors, queues, strings, etc.) and other useful things. Most compilers support the STL so it's good to use it. Templates are a bit hard to work with though, and you can get horrible error messages (I've seen some of 20 lines and more) but the library has proven to be a good base.
If you stick with ansi C++ and the STL you should have little problems porting it to any platform or switching compilers.

Dev-C++ is a free IDE based on mingw (g++ with all the windows headers), I think you can make COM objects with G++ too but I've never used it. VC++ of course has lots of support for COM objects, but is not free of course. About the object compatiblity, you can link masm object files with g++'s linker so that shouldn't be a problem.

Posted on 2003-11-01 10:27:45 by Thomas
Digital mars:


Open watcom:


Both are free and good (better than gcc imho).

Posted on 2003-11-01 11:32:01 by hitchhikr
1.) This is a list of (most?) free C\C++ compilers, including download links: http://www.thefreecountry.com/compilers/cpp.shtml

(Also see the assembler list: http://www.thefreecountry.com/compilers/assemblers.shtml)
Posted on 2003-11-01 11:48:44 by Masmer
Thanks for the suggestions so far! Im checking them out right now... So far Thomas' suggestion has me most interested as it apprears to fit the bill with out much setup.

I just compiled a a DX project with it and it appears to accept the headers (M$ Dx headers) directly. These headers are full of COM definitions... There may be some catch tho, that im missing so i remain skeptical until i finish writing a private test with my own com objects....

Edit: I managed to get MASM to link with Dev C++ quite easily (alot simpler than i thought it would be). Only *special* consideration in the MASM source is to put a C calling style in the proc definition "MyFunction PROC C Data:DWORD".

Last step is to write a sample COM object and see how it goes...

Posted on 2003-11-01 19:42:12 by NaN
Not looking good on the COM front....

It appears to have structure for it, but im drowning in all the headers trying to figure out why its not recognizing standard interfaces it inherits from (IID_IUnknown, etc.)

Looks like this might be a painful battle. And to make matters worse, I cant seem to find one example (in english) that come close to talking about COM with the Dev-C++, with Google... :rolleyes:

Im thinking i might stay where im happiest (Masm)...

I only wanted to explore C++ for managing the framework of COM objects, while writing their methods in MASM and linking their obj's... But seriously, all those C++ headers give me a migrane headache.... If you know of an alternate that will fit this bill, lemme know.. thanx

Posted on 2003-11-02 12:59:20 by NaN
Firstly Dev-C++ is highly buggy and (atleast i find it to be) a crappy ide.

I cant help you at the ide front but all i can assure you is that g++ supports the standard needed for compiling COM components. Its probably related to the way the compilers create virtual function tables or something, i forgot really but it is there.
But i dont know about the header files and stuff. I guess you can try the visual c++ header files. I dont think there should be any restriction using them,

Also G++ is obviously (then again this is my view) much better than the open watcom and digital mars compilers. Its the best choice after the Intel, Borland or Ms compilers.
Posted on 2003-11-02 13:54:26 by clippy
Ok.. thanx... G++ sounds like a good choice from what im hearing (and reading on the web). I will have to keep hacking thorugh it i guess... Im just surprised there is no source to be found showing how do this....
Posted on 2003-11-02 20:01:08 by NaN
The standard visual C headers and even the platform SDK includes are *very* VC specific. They use all kinds of things that are only present in VC so you can't use them with other compilers. Other compilers usually have their own set of headers (like mingw has).

Posted on 2003-11-03 04:15:15 by Thomas
how about c# ? it has support for COM objects, and .NET of course, and is freely available (just install the SDK/maybe even with the .NET framework itself and you have the compiler)
Posted on 2003-11-03 04:46:42 by Hiroshimator
BTW, I've settled on a combo of using MinGW (with MSYS) and either the Relo or MinGW Developer Studio IDEs. (All freeware)

They are the only ones I've found that use Win32 API intellisence: screenshots of Relo and MinGW Developer Studio.
Posted on 2003-11-03 09:36:49 by Masmer
Chrome have all this and support gcc/mingw. :grin:

Posted on 2003-11-03 10:32:13 by hitchhikr
The C/C++ compiler from Digital Mars is able to use the VC++ header files.
Posted on 2003-11-03 11:44:59 by Vortex
Also compatible with mfc and stl.

The ide of digital mars (IDDE) isn't free but chrome have some support for digital mars, isn't it bizarre ? :tongue:

Posted on 2003-11-03 11:59:24 by hitchhikr