LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Callback registration problem with Windows Media Player ActiveX control

Hello,everyone:

      I was adding a WMP ActiveX Control into my uir file .  When I tried to register callback functions for control events ,  the  callback registration functions always returned error code -2147220992, which probably meant "unknown error" ;   The registration seemed to be failed, because the callback functions were not fired.

      I tried with other kind of ActiveX controls and the registration of callbacks was successful. 

      I am using Windows 7 and CVI2009. The version  of the WMP is 12.0.7600.16415( Obtained with WMPLib_IWMPPlayer2GetversionInfo() function  ).

     Could anyone offer any possible causes and solutions for this problem?  

Thanks!

 

 

 

0 Kudos
Message 1 of 3
(3,681 Views)

Hi Chen,

 

Have you tried this example program? I have CVI 2009 and Windows 7 and this works without any problems.

 

Cheers,

0 Kudos
Message 2 of 3
(3,644 Views)

Hi, Michael

 

The  example program  works well. But there is no Callback registration function called in the program.

When I call callback reg function as  "  WMPLib_IWMPSliderCtrlEventsRegOnondragend (...)" , it returns an error. 

 

There are callback reg functions for different events (see the picture below), but only those for "_WMPOCXEvents " work without problem. Others return errors.

I've found a way to avoid such problem in my program,  but I think I should get you informed about it. Thanks for your attention!

 

Callback reg func for different events 

 

 

 

0 Kudos
Message 3 of 3
(3,626 Views)