CSE775 - Distributed Objects

Lecture #16 - Out-of-Proc Components and Activation

Revised: 4/20/2011
Home Courses Code Handouts CoreTech Books Articles Math Research Masters Projects SWDev WebDev News OtherLinks SiteDesign Graduates AllPages Office Hours Notices Contents

CSE681-SWMAA CSE686-IP CSE687-OOD CSE775-DO CSE776-DP CSE778-AWP CSE784-SWS

Lecture #01 Lecture #02 Lecture #03 Lecture #04 Lecture #05 Lecture #06 Lecture #07
Lecture #08 Lecture #09 Lecture #10 Lecture #11 Lecture #12 Lecture #13 Lecture #14
Lecture #15 Lecture #16 Lecture #17 Lecture #18 Lecture #19 Lecture #20 Lecture #21
Lecture #22 Lecture #23 Lecture #24 Lecture #25 Lecture #26 Lecture #27 Lecture #28

Syllabus

Web Resources:

Code Project Win32, COM, MFC DevelopMentor Windows Developer's Journal Windows Forms GotDotNet C# Corner IDL and WDSL COM at MSDN IDL Language base MIDL types OLE data types IDL attributes MIDL data types MIDL Language Reference conversion functions

Office Hours:Instructor & TAs

Content:

This lecture is concerned with Out-of-Process COM components and their activation.
  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, Project #2, Final Projects
  3. Material Presented Earlier - may be useful for Project #2:
    Apartments and Threading Presentation
    Introduces the notion of apartments and their use to manage COM components that many not share the same thread model with their clients.

    Threading Rules

    Component Calls Component
    This document discusses briefly building a workspace with a client that calls a component that, in turn, calls another component. The outer component marshals the an interface pointer for the inner component back to the client.
    ComponentCallsComponent Project
    This project provides all the code used to generate screen shots for the presentation in the previous item. The code provides brief, but useful, examples of the CComQIPtr and CComBSTR classes. I believe this is the best way to build a client for components built with ATL.

    Marshaling Interface Pointers between Client Threads
    You can't pass interface pointers between apartments, without marshaling. To do so breaks the COM threading model. This project shows you how to do that.

  4. Out-of-Process Components:
    OutProc Components Presentation
    Discusses the structure and activation of Out-of-Process components.

    Out-of-Proc class diagram, Out-of-Proc event trace,
    Out-of-ProcST structure chart, Out-of-ProcMT structure chart

    Interactive OutProc Demo
    We will build this simple project interactively in class.

    OutProcST Project - SingleThreaded Server
    Demonstrates how Out-of-Process Single-Threaded Server is structured. Uses Windows message loop.

    OutProcMT Project - MultiThreaded Server
    Demonstrates how Out-of-Process Multi-Threaded Server is structured. Uses Win32 events.

    ATL_OutProcST
    Demonstrates how to build a simple ATL Out-of-Proc component and C# client