Creating COM DLLs with Visual Basic - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Creating COM DLLs with Visual Basic

Description:

And COM EXEs run out-of-process, providing better fault tolerance because faults ... However, COM EXEs are always slower than COM DLLs because method calls must be ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 9
Provided by: abc105
Category:
Tags: com | basic | creating | dlls | exes | visual

less

Transcript and Presenter's Notes

Title: Creating COM DLLs with Visual Basic


1
Chapter 3
  • Creating COM DLLs with Visual Basic
  • Lesson 1 Creating COM DLLs and EXEs

2
Learning Objectives
  • Set project properties for COM DLLs.
  • Describe the different threading models for
    Visual Basic components.
  • Create, test, and debug COM components.

3
Introduction
  • In lesson 2, you learned how to create simple
    class modules from which you can create objects.
    In this lesson, you will go a step further by
    implementing class modules with COM code
    components.
  • Code components provide libraries of programmable
    objects because they contain one or more class
    modules.

4
COM DLLs vs COM EXEs
  • COM DLLs typically run in-process, allowing
    faster access to objects but are less
    fault-tolerant. If the DLL fails, the entire host
    process fails.
  • And COM EXEs run out-of-process, providing better
    fault tolerance because faults are limited to
    just the out-of-process EXE. If the EXE fails,
    other processes in the system will not fail.
    However, COM EXEs are always slower than COM DLLs
    because method calls must be marshaled between
    processes.

5
Threading Model
  • A process is an instance of an application that
    has an address space with four gigabytes of
    virtual memory and other resources.
  • Threads are objects that live in a process, and
    are the actual pieces of code that are executed
    on the processor.
  • Each process starts with one thread, called the
    primary thread. A process always has one or more
    threads executing.

6
Apartment Threaded
  • The apartment threaded is a COM-specific form of
    multithreading. It is essentially a way of
    describing a thread with a message queue that
    supports COM objects. All COM components created
    with VB use apartment model threading.

7
Using a Project Group to Test a COM DLL
  • To create a COM DLL in VB
  • To create a test project

8
Lab Creating a COM DLL
Write a Comment
User Comments (0)
About PowerShow.com