Siebel Service Handheld Guide > COM Extensibility > Process of Implementing a SCEC >
Generating and Configuring a SCEC
This task is a step in Process of Implementing a SCEC.
To generate and modify a SCEC using the ATL Wizard in Visual Studio 2005
- Create a new project in Visual Studio 2005 with the following settings:
- Project type = Visual C++ > Smart Device
- Template = ATL Smart Device Project
- Name = Name of the SCEC (for example, SampleSCEC)
- In the ATL Smart Device Project Wizard, click Next.
- Click the left arrow button to remove the Pocket PC 2003 SDK from the list of Selected SDKs.
- Click the right arrow button to add the Windows Mobile 5.0 Pocket PC SDK to the list of Selected SDKs. Click Next.
- In the Application Settings screen, choose Dynamic-link library for the Server type. Do not check any other options. Click Finish.
This step generates SCEC files, such as SampleSCEC.cpp and SampleSCEC.idl.
- Switch from the Solution Explorer to the Class view, right-click the SampleSCEC project, and select Add > Class.
- From the Visual C++ Category, select Smart Device. From Visual Studio installed templates, select ATL Simple Object. Click Add.
- In the Welcome to the ATL Simple Object Wizard screen, enter a name for the SCEC in the Short Name field (for example, SampleSCEC). This will automatically populate the other fields.
NOTE: If the project name is the same as the Short Name (for example, SampleSCEC), you must slightly modify the names of the .h and .cpp files, because by default they will be SampleSCEC.h and SampleSCEC.cpp, respectively. The ATL wizard will generate an error if you leave these names unchanged and click Next, because SampleSCEC.h is generated by MIDL and therefore cannot be used, and SampleSCEC.cpp has already been generated by the ATL wizard. For example, you can modify the names to be SampleSCECObj.h and SampleSCECObj.cpp.
- In the Options screen, select the following options:
- Threading Model = Free
- Interface = Custom
- Navigate to the Solution Explorer, right-click the generated .idl file (for example, SampleSCEC.idl), and select Properties.
- Navigate to Configuration Properties > General and change the value of the Tool property from MIDL Tool to Custom Build Tool. Click Apply.
- Navigate to Configuration Properties > Custom Build Step > General. In the Command Line text box, add the location of the Siebel (COMMIDL) .idl files in the following format:
midl /nologo /Oicf /I <action requests location> /I <events location> /h "<ProjName>.h" /iid "<ProjName>_i.c" "<ProjName>.idl"
midl /nologo /Oicf /I ..\..\com\interfaces\actionrequests /I ..\..\com\interfaces\events /h "SampleSCEC.h" /iid "SampleSCEC_i.c" "SampleSCEC.idl"
- Select Outputs and add the following files to the Outputs text box:
- Right-click the Project name and select Properties.
- Navigate to Configuration Properties > C/C++ > General and modify the settings to include the generated Siebel COMMIDL idl files, t_siebelscec.h, and shcescec.h by specifying the appropriate directories in the Additional Include Directories text box.