This article describes how to integrate Pro * C / C into the Microsoft Visual C 5.0 development environment. Includes the following:
Add PRO * C / C to the Tools menu list. Specify the file path. Establish a project file.
Add Pro * C / C to Tools menu list
When Pro * C / C is added to the Tools menu list, we can use the Pro * C / C precompiler directly in Visual C 5.0. Below is the specific steps to increase the list of Pro * C / C to the Tools menu: Run Microsoft Visual C 5.0, the following window appears: Click the "Tools" menu, the following window appears: Select the "Customize" menu item, the following dialog box: single The "Tools" page in the dialog box appears: Move the "Menu Contents" box scroll to the bottom area, the dialog box is as follows: Double-click the point scribe rectangular area, the dialog box is as follows Screen: Enter "Pro * C / C 8.0" on the blank area, press the Enter key, the dialog box is as follows:
In the "Command" box, enter the executable file name. For example: d: /orawin95/bin/procui80.exe
In the "arguments" box, enter "TargetName". When PRO * C / C 8.0 is selected from the Tools menu list, Visual C will pass the current project name to Pro * C / C . After PRO * C / C will open the extension of the project file directory directly in the project file. In the INITIAL Directory box, enter "$ (WKSPDIR). The "Customize" dialog box at this time is as follows:
Click "Close".
After completing the above steps, add Pro * C / C 8.0 into the Tools menu list, and we can run the Pro * C / C precompillary in Microsoft Visual C 5.0. Specify file path
In order to make Visual C can run Pro * C / C directly, we must set the path to the Pro * C / C execution file. If Microsoft Visual C is installed before installing Oracle 8.0, the path to the Pro * C / C execute file must be added to the Visual C environment. In addition, in order to make Visual C / C header files when compiling files, we must also set the PRO * C / C header path.
Specify execution file path
Below is a specific step of specifying the execution file path: Select the menu item "Options" from the "Tools" menu, the following dialog box appears: Click the "Directories" page, the dialog box is as follows: From "Show Director for" In the list box, "Executable Files" is selected. The dialog box is as follows: Move the "Directories" box scroll bar to the bottom area, double-click the point line rectangular area, the dialog box is as follows:
Enter the Oracle_home / bin directory on the blank area, for example: D: / ORAWIN95 / BIN Click "OK". This way we add directory D: / ORAWIN95 / BIN to the Visual C execution file path. Specifies the specific steps of the header path to specify the header file as follows: Select Options from the Tools menu, "Options" dialog box appears. Click the "Directories" page for the dialog. Select "Include Files" from the "SHOW DIRECTORIES for" list box. Move the scroll strip of the "Directories" box to the bottom area. Enter the Oracle_home / Pro80 / C / Include directory in the rectangular area of the point line. For example: D: / ORAWIN95 / PRO80 / C / INCLUDE Click "OK". This adds the directory D: / ORAWIN95 / PRO80 / C / INCLUDE to the Visual C header file path. Building a project file After adding the execution file path and the header file, we can start establishing and generating Pro * C / C applications. Below we explain how to create and generate console applications, the specific steps are as follows: Run Microsoft Visual C 5.0, click the "File" menu, appear as follows: From the "File" drop-down menu, click "New", as follows Dialog:
From the "Projects" page, select "Win32 Console Application", type the directory where the project file is located, such as D: / Example, and type the project file name, such as Exam01. For example, on the "Project Name". The dialog box is shown below:
Click "OK", the window appears:
So far, the console application framework is completed. After the application framework is established, we must also add the precompiled C or CPP file and the SQLLIB runtime file to the console application. Select "Add to Project" from the Project menu and select "Files". At this time, the following dialog is displayed:
Enter .c files in the "File Name" box, such as Exam01.c. After Click OK. Because the .c file does not exist, "The Specified File Does Not Exist. Do You Want To Add A Reference To The Project Anyway?". Click "Yes" so that the .C file is added to the project file. In the same way, add SQLLIB80.LIB files to the project file, the file where the file is located is Oracle_Home / Pro80 / lib / MSVC, such as D: / Orsvc/sqllib80/lib/msvc/sqllib80.lib. In some cases, you may need to add ORA803.LIB to the project file. So far, the project file is completely established. After the .pc file is precompiled as a .c or .cpp file, we can compile and link the application. We introduce specific steps to establish and generate applications. In addition, we can also integrate all Pro * C / C to the Visual C project file, and then automatically pre-compile the .PC file when compiling the project file, and all precompiled errors and warning messages are displayed in Visual C . The following is the step of integrating all Pro * C / C to the project file: right-click on the project file, the following graphics appears:
Select "Add Files to Project" from the pop-up menu, the following dialog box appears: Select the .pc file you want to add, such as Exam01.pc, and then click "OK". This way, we will add the .pc file to the project file. Right-click on the .PC file in "File View", select "Settings" from the pop-up menu, and the following dialog box appears:
In the "Build Command (S)" area, enter: $ (projdir) /../../../ bin / proc $ (projdir) / $ (InputName) .pc incdude = $ (Projdir) / ../..include include = "$ (msdevdir) /../ vc / include", for example: d: / orawin95 / bin / proc D: /sample/exam01/exam01.pc incrude = d: / orawin95 / pro80 / C / include incrude = d: / vc5 / vc / include parse = FULL In the "Output Files" area, enter: $ (projdir) / $ (InputName) .c (generated .c file) $ (projdir) / $ (InputName ) .cpp (generated .cpp), for example: d: /sample/exam01/exam01.c Click "OK". In this way, we will automatically prepress Pro * C / C applications when compiling project files.