Siebel Consumer Goods 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

  1. 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)
  2. In the ATL Smart Device Project Wizard, click Next.
  3. Click the left arrow button to remove the Pocket PC 2003 SDK from the list of Selected SDKs.
  4. Click the right arrow button to add the Windows Mobile 5.0 Pocket PC SDK to the list of Selected SDKs. Click Next.
  5. 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.

  6. Switch from the Solution Explorer to the Class view, right-click the SampleSCEC project, and select Add, then Class.
  7. From the Visual C++ Category, select Smart Device. From Visual Studio installed templates, select ATL Simple Object. Click Add.
  8. 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.

    Click Next.

  9. In the Options screen, select the following options:
    • Threading Model = Free
    • Interface = Custom

      Click Finish.

  10. Navigate to the Solution Explorer, right-click the generated .idl file (for example, SampleSCEC.idl), and select Properties.
  11. Navigate to Configuration Properties, then General and change the value of the Tool property from MIDL Tool to Custom Build Tool. Click Apply.
  12. Navigate to Configuration Properties, Custom Build Step, then 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"

    For example:

    midl /nologo /Oicf /I ..\..\com\interfaces\actionrequests /I ..\..\com\interfaces\events /h "SampleSCEC.h" /iid "SampleSCEC_i.c" "SampleSCEC.idl"

  13. Select Outputs and add the following files to the Outputs text box:
    • .\<ProjName>.tlb
    • .\<ProjName>.h
    • .\<ProjName>_i.c

      For example:

    • .\SampleSCEC.tlb
    • .\SampleSCEC.h
    • .\SampleSCEC_i.c

      Click OK.

  14. Right-click the Project name and select Properties.
  15. Navigate to Configuration Properties, C/C++, then 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.

    For example:

    ..\..\com\comimpl;..\..\com\scec;..\..\com\interfaces\midl

    Click OK.

Siebel Consumer Goods Handheld Guide Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.