Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / May 2005

Tip: Looking for answers? Try searching our database.

AcriveX function can be seen in VB but not in C++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Samokhvalov - 14 Mar 2005 11:40 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.