1.`function TIEEventsSink.GetTypeInfoCount(...) : HResult; { Result :=E_NOTIMPL; }`
2.`function TIEEventsSink.GetTypeInfo(...) : HResult; { Result :=E_NOTIMPL; }`
3.`function TIEEventsSink.GetTypeInfoCount(...) : HResult; { Result :=E_NOTIMPL; }`
4.`function TIEEventsSink.GetTypeInfo(...) : HResult; { Result :=E_NOTIMPL; }`
我面临着实施
IDispatch界面的问题.有四种方法,幸运的是其中有三种方法很简单:
function TIEEventsSink.GetTypeInfoCount(...): HResult;
{
Result := E_NOTIMPL;
}
function TIEEventsSink.GetTypeInfo(...): HResult;
{
Result := E_NOTIMPL;
}
function TIEEventsSink.GetIDsOfNames(...): HResult;
{
Result := E_NOTIMPL;
}
function Invoke(
dispIdMember: DISPID;
riid: REFIID;
lcid: LCID;
wFlags: WORD;
var pDispParams: DISPPARAMS;
var pVarResult: VARIANT;
var pExcepInfo: EXCEPINFO;
var puArgErr: DWORD
): HRESULT;
不想编写所有繁琐的样板代码,我肯定会有错误,我去谷歌搜索 – 而不是做任何工作.
我在the MSDN Documentation of IDispatch.Invoke发现了这个snippit:
Generally, you should not implement Invoke directly.
优秀!我还是不想实现它!继续阅读:
Instead, use the dispatch interface to create functions 07002 and 07003. For details, refer to 07002, 07003, 07006 and 07007.
Creating the IDispatch Interface链接说:
You can implement IDispatch by any of the following means:
[snip]
Calling the 07002 function. This approach is the simplest, but it does not provide for rich error handling or multiple national languages.
[snip]
很好,CreateStdDispatch它是:
Creates a standard implementation of the IDispatch interface through a single function call. This simplifies exposing objects through Automation.
06002
我打算称它为:
CreateStdDispatch(
myUnk, //Pointer to the object's IUnknown implementation.
anotherObject, //Pointer to the object to expose.
nil //Pointer to the type information that describes the exposed object (i has no type info)
dispInterface //the IUnknown of the object that implements IDispatch for me
);
1.`function TIEEventsSink.GetTypeInfoCount(...) : HResult; { Result :=E_NOTIMPL; }`
2.`function TIEEventsSink.GetTypeInfo(...) : HResult; { Result :=E_NOTIMPL; }`
3.`function TIEEventsSink.GetTypeInfoCount(...) : HResult; { Result :=E_NOTIMPL; }`
4.`function TIEEventsSink.GetTypeInfo(...) : HResult; { Result :=E_NOTIMPL; }`
我面临着实施
IDispatch界面的问题.有四种方法,幸运的是其中有三种方法很简单:
function TIEEventsSink.GetTypeInfoCount(...): HResult;
{
Result := E_NOTIMPL;
}
function TIEEventsSink.GetTypeInfo(...): HResult;
{
Result := E_NOTIMPL;
}
function TIEEventsSink.GetIDsOfNames(...): HResult;
{
Result := E_NOTIMPL;
}
function Invoke(
dispIdMember: DISPID;
riid: REFIID;
lcid: LCID;
wFlags: WORD;
var pDispParams: DISPPARAMS;
var pVarResult: VARIANT;
var pExcepInfo: EXCEPINFO;
var puArgErr: DWORD
): HRESULT;
不想编写所有繁琐的样板代码,我肯定会有错误,我去谷歌搜索 – 而不是做任何工作.
我在the MSDN Documentation of IDispatch.Invoke发现了这个snippit:
Generally, you should not implement Invoke directly.
优秀!我还是不想实现它!继续阅读:
Instead, use the dispatch interface to create functions 07002 and 07003. For details, refer to 07002, 07003, 07006 and 07007.
Creating the IDispatch Interface链接说:
You can implement IDispatch by any of the following means:
[snip]
Calling the 07002 function. This approach is the simplest, but it does not provide for rich error handling or multiple national languages.
[snip]
很好,CreateStdDispatch它是:
Creates a standard implementation of the IDispatch interface through a single function call. This simplifies exposing objects through Automation.
06002
我打算称它为:
CreateStdDispatch(
myUnk, //Pointer to the object's IUnknown implementation.
anotherObject, //Pointer to the object to expose.
nil //Pointer to the type information that describes the exposed object (i has no type info)
dispInterface //the IUnknown of the object that implements IDispatch for me
);