C U T B H P N

Lecture #8 - Interface Definition Language

Web Resources:

Linux Tutorials eclipse Code Project SysInternals Best SysInternals Tools Dr. Dobb's Journal Windows Forms COM at MSDN IDL Language base MIDL types OLE data types IDL attributes MIDL data types MIDL Language Reference

Content:

Today we discuss Interface Definition Language (IDL) and COM types.
  1. Syllabus
    Describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
  2. Project #1, Project1HelpS19
    Final Projects
  3. Project #1 Prototype
    This demo has a client, a using component, and a used component. The client creates both used and using components, then passes a pointer to used to the using to set up that communication. This structure would work fine for Project #1, where the used component is FileMgr and the using component is the TextSearch component. This was supposed to be a simple demonstration of how to use the ATL wizards. Unfortunately they are broken in Visual Studio 2017. To do the demonstration, I installed VS 2015 to carry out the demo. I then loaded that project into Visual Studio 2017 to execute and demonstrate the communication patterns between client, used, and using components.
  4. You will find in the CSE775/Code/Project1HelpS19, a demonstration of FileSystem, a package of file, path, and directory operations implemented with classes:
    • Block and File
    • FileInfo
    • Path
    • Directory
    I modeled the design of these after the excellent System.IO classes of the same names in the .Net library. There are versions for both Windows and Linux.
  5. Microsoft Component Object Model (COM):

  6. COM Tools:

  7. Building COM Components

    Instructions and Fixes:
    Building COM components is more complicated than building non-COM C++ projects. Find instructions here.
  8. In-Process Components:

    Objects Supporting Multiple Interfaces
    Demonstrates how an ordinary C++ class can support multiple interfaces.

    Virtual Function Pointer Table
    You won't understand IUnknown::QueryInterface unless you understand this diagram.

    In-Proc Component code
    We will go over this code, line-by-line.

    class diagram, structure chart, activation diagram, products of MIDL compilation
    These diagrams will help you understand the structure and operation of the In-Proc example.

    Building Raw C++ COM component - detailed notes

  9. IDL and COM types

    IDL Presentation, pptx
    These slides discuss how to describe the structure of a COM interface.

    BSTRs - COM Strings, SafeArrays - COM Arrays, Variants - COM ObjectType

    Oleautomation types

    Interfac Project - an Out-Of-Proc Component
    Shows how to pass most common types of data through COM interfaces, e.g., basic types, strings, pointers, and arrays.

    To build OutOfProc components you need to:
    • compile the IDL file - right click on idl file in server explorer and select compile
    • register each of the proxyStub components (they are COM components) - build, then tools->Register Component
      (assumes you've set regsvr32 in tools menu)
    • run the OutOfProc server - set as startup, build and run
      OutOfProc servers register themselves with the ROT the first time you run them.
    • run the client - set as startup, build and run

    OutProc Components Presentations, ppt

    ATL Inproc_Ex1
    Converting the "raw C++" solution to an ATL solution.

    FileHandler Project
    Uses SafeArrays - will be helpful for Project #1

  10. Web API - REST

CST strip