 Re: Using Microsoft Foundation Classes with Borland C++ 3.1
Organization: SPSS, Inc.
Distribution: usa
Lines: 53

In article <1qv1rc$>,   writes:
> Hi all,
> 
> has anybody tried to compile CTRLTEST from the MFC/SAMPLES directory,
> after compiling the MFC-libs with BWC ?
> 
> Seems to me, that BWC isn't able to distinguish pointers to overloaded
> functions.
> For example, imagine the following 2  functions:
> void same_name  
> void same_name 
>  
> After trying the whole day, I think, with BWC its impossible to take the
> adress of one of the above two functions and assign it to a properly defined
> function pointer. 
> Am I right ? Has anybody else had this problem ?
> 
> 	thanx

I think you may be chasing the wrong problem.  I don't think it is the
function overloading at all-- I do that sort of thing all of the time
in BC++ without a hitch.  The big problems I have encountered in
porting MFC to BC++ is that fact that MFC _depends_ on a couple of
invalid C++ assumptions.

I have never gotten the _entire_ ctrltest app to run under BC++, but
the reason is that MS makes some bad assumptions about the order in
which static/global objects are initialized .  The problem is in the
owner-draw menu code somewhere-- if you comment out that section, all
other pieces of ctrltest work fine.

Two other major gotchas I have found using MFC under BC++:

- The CFile::OpenFlags enum uses hard-coded numbers for the open mode,
  rather than the manifest constants defined in fcntrl.h .

- All of the MFC collection classes depend on another bad C++
  assumption-- that a reference to a base object can used be in place
  of a reference to a derived object .

I am sure there are other problems along the same lines, but I have
not encountered them .  I have not seen MFC 2.0 yet, but I hope
that some of these will be addressed.  If they are not, all of MS's
hype about portability to other vendor's compilers will be just that.

-- 
      If these were my employer's opinions, I wouldn't be posting them.
###############################################################################
  "Whoever said nothing lasts forever was obviously  # R. Brendler
   NOT a Cubs fan..." - Mike Royko                   # SPSS, Inc. - Chicago IL
