When comparing the advantages and disadvantages of VC, VB, and Delphi, it is often said that the program interface made by VB and Delphi is beautiful.
And VC is always rigid.
For beginners, the ever-changing attribute settings of each control in VB and Delphi are indeed charming and numerous
The controls increase the color of your program. VC is a lot worse, just a few common
The font and color cannot be set.
VC really cannot? Of course not. The essence of VC is hidden, not exposed. Don't get me wrong, I
The purpose of writing this article is not to tell you the essence of VC. I have not understood the essence of VC. My
The purpose is to recommend a class library-cjlibrary. With this library, you can make a library like outlook,
Devstudio is a beautiful and convenient program interface. (For this purpose, I have been removed from the optical Moderator:-<)
This article aims to enable CJ to be easily used by people who only know about VC.
Detailed Content of CJ's implementation principle. If possible, I will write some more articles in the future and talk about my VC interface development.
Experience.
The installation process is very simple. All components are selected and take up 4.3m space. For ease of expression, see the following document
Path refers to the subdirectories and files in the CJ installation directory.
Cjlibrary/*. * is the source code of CJ, excluding. H files.
Include/*. * is the header file of CJ. All the header files required by your program are included here.
Example/*. * is the example file of CJ. If you can read the code, you will know how to use cjlibrary
Yes.
If you are diligent, stop listening to me and read it now!
Wizards/*. * is a number of wizard programs. After these programs are compiled
Then several wizard supporting CJ are automatically available. This is the easiest way to use cjlibrary.
Let's talk about it here ......
(Note: Some knowledge and steps will be described in detail when they are involved for the first time.
I will repeat it with caution .)
Before using CJ, make some preparations, that is, compile the. lib and
. Dll file.
Open cjlibrary/cjlibrary. DSW. If you are using vc6, a prompt box appears.
Whether to convert a vc5 project into a vc6 project. The answer is OK. No problem. If vc5 is used,
There is no such prompt. CJ is compiled under vc5.
First, switch to the active project configuration. Select set active from the build menu.
Configuration... set the activation configuration to CJLibrary-Win32 release, and then press F7
Translation. Then switch the activation configuration to CJLibrary-Win32 debug, compile. A program in VC can
There are multiple configurations. The default configurations are debug and release, which are used for debugging and final release respectively.
Execution file. The current task is to generate required library files for two different configurations.
There are two Unicode configurations in this project, which are prepared for NT programs that support Unicode. If
You do not need Unicode support.
At this time, a lib directory appears under the CJ installation directory, which contains the generated library file. Cj608lib .*
Corresponding to release configuration, cj608libd. * Corresponds to debug configuration. *. Lib is used for source program links.
Library file, *. dll is the dynamic link library file called when the execution program is running.
The library files generated by cjlibrary/cjlibrary. DSW are used for dynamic links, that is,
The final execution program must support the. dll file to run. Can the program be detached from. dll?
Why? Of course.
Cjlibrary/cjlibrarystatic. DSW is used to generate static link library files. Open and edit
For various configurations, cj608libstatic. lib and cj608libstaticd. Lib are added to the lib directory.
Library files. These two files are much larger in size.
Let's talk about how to make your application statically active connections later.
There are six source codes for wizards/. Each compilation adds one to devstudio.
Windows, outlook is used as an example here.
Open outlook/outlook. DSW,
First switch the activation configuration to the Outlook-Win32 release and then compile. In this case
Outlook wizard has been added to the Integration Environment of devstudio.
Use it to create your outlook.
The creation process is as follows: file-> New-> projects-> cj outlook Appwizard,
Add the project name (for example, I use outlookdemo) and location to the project name.
Specify the directory where you want to save the project,
Then OK! Ignore the following dialog box and click OK again! A cj project belongs to you.
.
Compile the code to see if an error occurs:
Cannot open include file: 'cjlibrary. H': no such file or directory
This is because you did not add 'cjlibrary. H' to the include directory. How to add it?
Project-> Settings; in the dialog box, change settings for to all invocations;
Click C/C ++, change category to Preprocessor, and set the absolute path of CJ's include directory
Added to additional includedirectories; last OK!
Compile again. There is still an error. The prompt is:
Link: Fatal error lnk1104: cannot open file "cj608libd. lib"
Hehe... Don't worry, this is because your library directory still has the CJ path.
Project-> Settings-> all deployments-> link; Change category to input;
Add the absolute path of CJ's lib directory to additional library path. Finally, OK!
This compilation is okay, but there is another problem when you press Ctrl + F5 to run the program. Haha... copy
LIB/*. DLL to your project directory. It is outlookdemo/for me /.
Now, press Ctrl + F5 to celebrate the first running of your first CJ application ...... Eye?
Bright before?
Currently, it is a dynamic link, so support for. dll is required. Change it to static link.
Project-> Settings-> all deployments-> General; Modify Microsoft
The foundation classes is the use MFC in a static DLL. Then, bulid-> rebuild
All. The generated execution file does not need the support of CJ. dll.
The method for adding include and library directories described above is only valid for a single project. If you want
Once and for all, so that all future projects can automatically find the CJ library and header file, then tools->
Options-> directories: add the corresponding path to both include files and library file.
In fact, the two most commonly used wizard are wizards/MDI and wizard/SDI.
It's only pp.
Now, you can compile other wizard and do the project on your own.
From: http://hi.baidu.com/cwin/blog/item/259cadec2b58382762d09feb.html