Hi all,
i'm using a third party activex component in a C++ application. This
component was initially intended to be used with VB. Every VB project
can use a SetFocus function. Everything works well. But if the component
is used in a C++ application, the function is not visible. The tlh file
generated from the ocx does not contain the function declaration, so the
projectg can't be compiled. Any efforts to access the function
dynamically doesn't succeed, IDispatch doesn't see the function.
Does somebody have ideas how to access the function?
Regards
Alex
Douglas J. Steele - 14 Mar 2005 23:23 GMT
I'd suggest asking this in a newsgroup related to C++.
This newsgroup is for questions about using ActiveX controls in Access, the
database product that's part of Office Professional.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Hi all,
>
[quoted text clipped - 11 lines]
>
> Alex
Cristian Amarie - 17 Mar 2005 11:32 GMT
Retrieve the control IDispatch interface and call GetIDsOfNames to retrieve
its DISPID.
IDispatch *pDispCtl = <get control dispatch>;
LPOLESTR lpName = L"Method-or-Property-Name"; // replace with the desired
method or property name
DISPID dispidMethodOrProp = 0;
HRESULT hr = pDispCtl->GetIDsOfNames(IID_NULL,
&lpName, 1, MAKELCID(...), &dispidMethodOrProp);
if ( SUCCEEDED ( hr ) )
{
// use dispidMethodOrProp in Invoke call
}
Cristian Amarie
> Hi all,
>
[quoted text clipped - 11 lines]
>
> Alex
Alex Samokhvalov - 18 Mar 2005 10:32 GMT
Hello Cristian,
thanks for your reply. Unfortunately, the dynamic method invocation
doesn't work either. The GetIDsOfNames function doesn't succeed and
afterwards the lpName is set to NULL.
I've thought all ActiveX clients use the same reflection interface but
apparently they don't.
Regards
Alex
> Retrieve the control IDispatch interface and call GetIDsOfNames to retrieve
> its DISPID.
[quoted text clipped - 28 lines]
>>
>>Alex
helen - 17 May 2005 07:17 GMT
"Alex Samokhvalov" <welcome@s_p_a_m.com>
??????:OSCMG15KFHA.1156@TK2MSFTNGP09.phx.gbl...
> Hello Cristian,
>
[quoted text clipped - 41 lines]
> >>
> >>Alex