Threading Module是针对 ActiveX DLL而设定的,分为Single以及Aparment。对于
Aparment,一般的解释是:
单元线程(有时称为公寓线程),这种线程模式允许服务器同时拥有多个相同的Aparment再
不同的服务器线程中执行,这样可以同时服务多个客户端。但是每一个Aparment中只有一个单一的线程可以执行这个Aparment中的COM对象。在该模式下,局部变量是安全的,但是由于服务器中可能有多个线程同时执行,所以每一个COM对象必须保护全局变量的存取。
每个对象对应一个线程应该就是对于每一个调用该对象的线程,系统都会建立一个对象实例
可能我说的不是太明白,你可以参考相关的COM书籍。
MSDN
中对于VB建立的ActiveX DLL的Aparment的解释是:
In Visual Basic, apartment-model threading is used to provide thread safety. In apartment-model threading, each thread is like an apartment — all objects created on the thread live in this apartment, and are unaware of objects in other apartments.

解决方案 »

  1.   

    请问这道题目该选什么?
    You implement a COM component in an ActiveX DLL project. You want to use this component in a multithreaded client application. You also want to allow any thread in a client application to be able to create an instance of this component on the client's thread. What must you do? 
    A. Set the Instancing property to SingleUse. 
    B. Set the Instancing property to MultiUse. 
    C. Set the threading model to Apartment Threaded 
    D. Set the thread pool size to be greater than 1. 
      

  2.   

    C. Set the threading model to Apartment Threaded