Siebel Object Interfaces Reference > Accessing Siebel COM Data Server with C++ >
Building the Siebel COM Client in C++
The following procedure explains how to build the Siebel COM Client in C++.
To build the Siebel COM client in C++
- In Microsoft Visual C++, choose File > New > Project.
- Select the
(exe) project type.
- In the Project name field, enter
SiebelCOM, and then click OK.
The MFC AppWizard starts.
- Select the Dialog-based option and then click Next.
- In the "What other support would you like to include?" frame, check Automation and clear ActiveX Controls, and then click Next. Click Next again.
- Click Finish.
Microsoft Visual C++ displays the project information, as shown in the following illustration.
- Click OK.
The Application Wizard generates the standard MFC code that serves as the skeleton for this project. Headers and libraries necessary to support COM automation are included. Refer to the Microsoft Visual Studio [MSDN] documentation for a detailed description of the MFC libraries.
- The newly created dialog box appears in the workspace. You can resize the box and change the text in the label by editing its properties. Right-click the label in the dialog box to edit its properties. Modify the dialog box so that it looks something like the following illustration.
- Choose View > ClassWizard > Automation.
- Click Add Class > From a type library.
- Navigate to the
C:\Sea750\client\bin folder. Choose
- In the Confirm Classes dialog box, make sure all five Siebel classes are selected, and then click OK. Click OK again to close the Class Wizard.
- Add code to communicate with the Siebel COM Server.
- In the workspace window, click the FileView tab.
- Expand the Source Files and Header Files folders, as shown in the following illustration.
- Double-click the
The code window opens, as shown in the following illustration.
- Enter the code that is highlighted in boldface in Figure 9 into the
Figure 9. Code for SiebelCOMDlg.h
- Choose File > Open and select the
SiebelCOMDlg.cpp file. Add the code that is highlighted in boldface in Figure 10 to the
Figure 10. Code to Be Added to OnInitDialog Routine in SiebelCOMDlg.cpp
- In the same file, add the code that is highlighted in boldface in Figure 11 and Figure 12 to the
OnOKDialog procedure. Make sure that the line beginning with
sApp.LoadObjects points to the location of the CFG file you intend to use. In the line beginning with
sApp.Login, make sure that you have entered a valid logon name and password.
Figure 11. Code to be Added to OnOKDialog Routine in SiebelCOMDlg.cpp
Figure 12. Code to Be Added to OnOKDialog Routine in SiebelCOMDlg.cpp
When you have finished creating your program, test it to make sure it works properly.