本文介绍了从常规DLL(C ++)创建COM对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用C ++创建的常规DLL,可以从VBScript文件运行VBScript过程. DLL能够将变体字符串和safearray作为参数传递给脚本过程.但是,对于名称/值对的向量,我想通过将向量包装在COM类中并将其IDispatch指针作为参数传递给脚本,以将其传递给脚本过程.是否可以拥有一个COM类并在常规DLL中创建COM对象,然后将其IDispatch接口获取一个变量变量?如果是,怎么办(如果可能,请提供示例代码)?

I have a regular DLL created in C++ that can run VBScript procedures from a VBScript file. The DLL is able to pass variant strings and safearray as parameters to script procedures. However, for a vector of name-value pairs I want to pass it to the script procedure by wrapping the vector in a COM class and passing its IDispatch pointer as parameter to the script. Is it possible to have a COM class and create the COM object inside a regular DLL, and then get its IDispatch interface to a variant variable? If yes, how (sample codes if possible)?

推荐答案



这篇关于从常规DLL(C ++)创建COM对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 17:19