Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait till Do() method of an ActiveX control is finished

Status
Not open for further replies.

darioars

Technical User
Oct 30, 2002
21
0
0
DE
Hi guys!

I have an application containing an ActiveX control, which allows me to send commands to it by means of its Do() method. So, I decided to do some calls to this method within my program but when I debug it, the Do() calls are got through without getting the result of its execution. I'm not sure if it takes some time to execute this calls or what, but I'm interested in a function or whatever that allows me to wait till the Do() method has really become effective.

Any suggestion?

Thanks in advance!

Darío
 
what id Do()?

Ion Filipski
1c.bmp
 
You mean that if I had the ID of the Do() method I could wait for it?
 
Is it the DISPID of member function "Do"?
If so, I believe you call in some way the IDispatch method Invoke. It returns a HRESULT, let's say hr.

hr = pDisp->Invoke(...DISP_ID_OF_DO....);
if(FAILED(hr))
::MessageBox(0, "invoke of method Do failed", "", 0);

So, first of all you should see if method invokation succeeded. Usualy if succeeds you don't have to synchronize them because the COM environment do it. Else if the method is asynchronous, there should be some notification mechanisms, for example adise sinks or connection points.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top