英语翻译//msdn
TheATLSimpleObjectWizard'sAttributespageprovidesanoptionthatallowsyourclasstoaggregat...
The ATL Simple Object Wizard's Attributes page provides an option that allows your class to aggregate the free threaded marshaler (FTM).
The wizard generates code to create an instance of the free threaded marshaler in FinalConstruct and release that instance in FinalRelease. A COM_INTERFACE_ENTRY_AGGREGATE macro is automatically added to the COM map to ensure that QueryInterface requests for IMarshal are handled by the free threaded marshaler.
The free threaded marshaler allows direct access to interfaces on your object from any thread in the same process, speeding up cross-apartment calls. This option is intended for classes that use the Both threading model.
When usingthis option, classes must take responsibility for the thread-safety of their data. In addition, objects that aggregate the free threaded marshaler and need to use interface pointers obtained from other objects must take extra steps to ensure that the interfaces are correctly marshaled. Typically this involves storing the interface pointers in the globalinterface table (GIT) and getting the pointer from the GIT each time it is used. ATL provides the class CComGITPtr to help you use interface pointers stored in the GIT. 展开
The wizard generates code to create an instance of the free threaded marshaler in FinalConstruct and release that instance in FinalRelease. A COM_INTERFACE_ENTRY_AGGREGATE macro is automatically added to the COM map to ensure that QueryInterface requests for IMarshal are handled by the free threaded marshaler.
The free threaded marshaler allows direct access to interfaces on your object from any thread in the same process, speeding up cross-apartment calls. This option is intended for classes that use the Both threading model.
When usingthis option, classes must take responsibility for the thread-safety of their data. In addition, objects that aggregate the free threaded marshaler and need to use interface pointers obtained from other objects must take extra steps to ensure that the interfaces are correctly marshaled. Typically this involves storing the interface pointers in the globalinterface table (GIT) and getting the pointer from the GIT each time it is used. ATL provides the class CComGITPtr to help you use interface pointers stored in the GIT. 展开
2个回答
展开全部
ATL简单对象向导的属性页提供了使您的类与自由线程封送拆收器(FTM)相复合的选项。
向导生成代码,在 FinalConstruct 中创建自由线程封送拆收器的实例,在 FinalRelease中释放该实例。COM_INTERFACE_ENTRY_AGGREGATE 宏结构被自动添加到COM映射中,以确保自由线程封送拆收器能处理 QueryInterface 对于IMarshal 的请求。
自由线程封送拆收器允许在同一进程的任何线程内的对象直接访问其接口,以加速跨单元调用。此选项适用于使用两种线程模型的类使用。
在使用此选项时,类必须负责其数据的线程安全。此外,复合了自由线程封送拆收器并需要使用从其他对象中获取的接口指针的对象,必须执行附加步骤以确保接口正确封送。它通常包括在全局接口表(GIT)中存储接口指针,然后每次使用时从GIT中获取指针。ATL提供CComGITPtr 类来帮助您使用在GIT中存储的接口指针。
向导生成代码,在 FinalConstruct 中创建自由线程封送拆收器的实例,在 FinalRelease中释放该实例。COM_INTERFACE_ENTRY_AGGREGATE 宏结构被自动添加到COM映射中,以确保自由线程封送拆收器能处理 QueryInterface 对于IMarshal 的请求。
自由线程封送拆收器允许在同一进程的任何线程内的对象直接访问其接口,以加速跨单元调用。此选项适用于使用两种线程模型的类使用。
在使用此选项时,类必须负责其数据的线程安全。此外,复合了自由线程封送拆收器并需要使用从其他对象中获取的接口指针的对象,必须执行附加步骤以确保接口正确封送。它通常包括在全局接口表(GIT)中存储接口指针,然后每次使用时从GIT中获取指针。ATL提供CComGITPtr 类来帮助您使用在GIT中存储的接口指针。
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询