描述:
我是一个菜鸟.
现在正在使用一个别人的控件.
但是这里我不知道该什么做了.
下面是在一个格子中输入完以后触发的事件.
void CXl8Dlg::OnSafeEndEditTtf11(LPDISPATCH FAR* EditString, LPDISPATCH FAR* CancelFlag)
{
//我想EditString 应该是输入的数据,我想得到这个输入该怎么办啊? .
}
解决方案1:
用以下四个函数调用所有功能
Method Description
IDispatch::GetTypeInfoCount This method retrieves the number of type information interfaces that an object provides, either 0 or 1.
IDispatch::GetTypeInfo This method retrieves the type information for an object.
IDispatch::GetIDsOfNames This method maps a single member name and an optional set of parameter names to a corresponding set of integer dispatch identifiers (DISPIDs), which can then be used on subsequent calls to Invoke.
IDispatch::Invoke This method provides access to properties and methods exposed by an object.
LPDISPATCH 是自动化接口,指向IDispatch接口的指针,LPDISPATCH FAR*则是指向自动化接口的指针
IDispatch是(from MSDN):
IDispatch
IDispatch is a COM interface that is designed in such a way that it can call virtually any other COM interface. Developers working in Microsoft® Visual Basic® often cannot call COM interfaces directly, as they would from C or C++. However, when their tool supports IDispatch, as Visual Basic does, and when the object they want to call supports IDispatch, they can call its COM interfaces indirectly.