Siebel Object Interfaces Reference > Accessing Siebel COM Data Server with C++ >

Building the Siebel COM Client in C++


To build the Siebel COM client in C++

  1. In Microsoft Visual C++, choose File > New > Project.
  2. Select the MFC AppWizard (exe) project type.
  3. In the Project name field, enter SiebelCOM, and then click OK.
  4. The MFC AppWizard starts.

  5. Check the Dialog-based option and then click Next.
  6. In the "What other support would you like to include?" frame, check Automation and clear ActiveX Controls, and then click Next. Click Next again.
  7. Click Finish.
  8. Microsoft Visual C++ displays the project information.

  9. Click OK.
  10. 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.

  11. 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 this:
  12. Choose View > ClassWizard > Automation.
  13. Click Add Class > From a type library.
  14. Navigate to the C:\Sea750\client\bin folder. Choose sobjsrv.tlb.
  15. 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.
  16. Add code to communicate with the Siebel COM Server.
    1. In the workspace window, click the FileView tab.
    2. Expand the Source Files and Header Files folders, as shown.
    3. Double-click the SiebelCOMDlg.h file.
    4. The code window opens.

    5. Enter the code that is highlighted in boldface in Figure 15 into the SiebelCOMDlg.h file.

Figure 15.  Code for SiebelCOMDlg.h

Click for full size image

  1. Choose File > Open and select the SiebelCOMDlg.cpp file. Add the code that is highlighted in boldface in Figure 16 to the OnInitDialog procedure.

Figure 16.  Code to Be Added to OnInitDialog Routine in SiebelCOMDlg.cpp

Click for full size image

In the same file, add the code that is highlighted in boldface in Figure 17 and Figure 18 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 17.  Code to be Added to OnOKDialog Routine in SiebelCOMDlg.cpp

Click for full size image

Figure 18.  Code to Be Added to OnOKDialog Routine in SiebelCOMDlg.cpp

Click for full size image

When you have finished creating your program, test it to make sure it works properly.


 Siebel Object Interfaces Reference 
 Published: 18 June 2003