How to compile the MFC program under C ++ Builder 3.0?

zhaozj2021-02-11  173

How to compile the MFC program under C Builder 3.0?

Although C Builder 3.0 is the next version of Borland C 5.02, the MFC is supported, but it is not easy to use MFC in C Builder 3.0. Not directly writing a MFC Native Code and checking the MFC Compatibility in Project Option is so simple, if you only do so, ensure that you will get a bunch of Warnning and Error when compiling.

To make you easily compile the MFC with BCB, we must move your hands and feet, and put this project of this hand to Object repository; you only need to press New's New. Start your MFC in BCB road. Step 1,

New a new Project

STEP 2,

Add to Conditionals / Conditional Defines of Directories / Conditionals in Project Option

_X86__windows_msc_ver = 1100_afx_portable_afx_noforce_libs_mt_crt_portable_afx_no_debug_crt

These compilation parameters. And remember to add $ (BCB) / include / mfc in the include Path. Step 3, then put the MFC Compatibility to check the MFC Compacti,

STEP 4, which followed, put the files, with the text editor to modify this Project's BPR file. Find cflag1 = ...... This line gives this line as cflag1 = -hc -w -k -r- -y -v -vi- -c -w-par -w-inl -w-hid -w-aus -g0 -wm -w

Find cflag3 = ... This line will give this line as cflag3 = -tkh30000 -VF

Finally, I found allib = .... This line will give this line to allib = $ (libraries) Nafxcw.lib import32.lib CW32MT.LIB

Then it is the deposit! Step 5, so, you can enjoy the MFC in BCB3 directly!

Don't know in this example, the compiled file will be the version of Static Link, not Dynamic Link, how do you do Dynamic Link MFC Library in BCB 3? Sell ​​a clearance first, look at the examples attached to the BCB! In addition, there are many ways to link VCL and MFC in BCB, which can be roughly divided into two categories:

1. Take TAPPLICATION as the main body, and the program is mixed using other classes provided by VCL and MFC, such as CDC, CPOINT, CFILE, etc. ... 2, with the MFC's CAPP as the main body, the FORM combined in the monogram is called.

How do these two categories have completed in the BCB? Smart readers, move your brain, think about it!

转载请注明原文地址:https://www.9cbs.com/read-4906.html

New Post(0)