3,245
社区成员
发帖
与我相关
我的任务
分享
static BYTE parms[] = VTS_BSTR VTS_BSTR ;
InvokeHelper(0x1, DISPATCH_METHOD, VT_EMPTY, NULL, parms,"102","2141");
// Implementation
protected:
~CfirstOcxCtrl();
DECLARE_OLECREATE_EX(CfirstOcxCtrl) // Class factory and guid
DECLARE_OLETYPELIB(CfirstOcxCtrl) // GetTypeInfo
DECLARE_PROPPAGEIDS(CfirstOcxCtrl) // Property page IDs
DECLARE_OLECTLTYPE(CfirstOcxCtrl) // Type name and misc status
// Message maps
DECLARE_MESSAGE_MAP()
// Dispatch maps
DECLARE_DISPATCH_MAP()
afx_msg void AboutBox();
// Event maps
DECLARE_EVENT_MAP()
// Dispatch and event IDs
public:
enum {
};
void MyFunction(LPCSTR str1,LPCSTR str2);
BEGIN_DISPATCH_MAP(CfirstOcxCtrl, COleControl)
DISP_FUNCTION(CfirstOcxCtrl, "MyFunction", MyFunction,VT_I2,VTS_BSTR VTS_BSTR)
DISP_FUNCTION_ID(CfirstOcxCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
END_DISPATCH_MAP()
。。。
void CfirstOcxCtrl::MyFunction(LPCSTR s1,LPCSTR s2)
{
// 进到这里以后s1 和 s2都是乱码,不知道为什么
}