Although C + + Builder 3.0 is the next version of Borland C + + 5.02, it supports MFC as well, but it's not easy to use MFC under C + + Builder 3.0. Not directly to write an MFC native
Code and then tick the MFC compatibility in Project Option If you only do this, make sure you get a bunch of warnning and error at compile time.
To enable you and BCB to easily compile MFC, all we have to do is to move our hands and put this Repository project file into object, and then you just have to press new on the menu to start your MFC in BCB.
Step 1,
New Project
Step 2,
In the conditionals\conditional defines of the Directories\conditionals page, give
Join:
_x86_
_windows
_msc_ver=1100
_afx_portable
_afx_noforce_libs
_mt
_crt_portable
_afx_no_debug_crt
These several compile parameters.
And remember to add $ (BCB) \include\mfc to this item in include path.
Step 3,
Then on the page of Advance compilers, the MFC compatibility is selected,
Step 4,
Immediately, save the file and use a text editor to modify the Project's BPR file.
Find CFLAG1 = ... This line
Give this line to the
CFLAG1 =-od-hc-w-k-r--y-v-vi--c-w-par-w-inl-w-hid-w-aus-g0
-wm-w
and find CFLAG3 = ... This line
Give this line to the
CFLAG3 =-TKH30000-VF
Finally find Alllib = ..... This line
Give this line to the
Alllib = $ (libfiles) $ (libraries) Nafxcw.lib Import32.lib Cw32mt.lib
And then it's the archive ROM!
Step 5,
In this way, you can enjoy MFC directly under the BCB3!
Not to know
In this example, the compiled file will be the version of static link, not dynamic link,
How would you like to do the dynamic Link MFC library under BCB 3? Here, let's sell a few words and see
The example enclosed in the BCB!
In addition, there are many ways to link VCL with MFC in BCB, which can be broadly divided into two categories:
1, with Tapplication as the main body, and the program mixed use of VCL and MFC provided by other classes, such as
CDC, CPoint, CFile, etc...
2, MFC as the main body of CApp, in the menu called VCL combination of form.
And how are these two categories to be completed in BCB? Move your brain and think about it.