Applies To: |
|
Summary: |
I have a page with an ActiveX object on it
and I am trying to control it using Cicode on a separate pop-up
page. However, this does not work and I get hardware alarms
similar to the following: Why does this not work and how can I work around this? |
Solution: |
When you insert an ActiveX object on a
page it becomes bound to that page and therefore, any ActiveX
Cicode functions that are called to access that ActiveX object will
only work when that particular page is in focus. As soon as
you open up a separate pop-up page, the parent page containing the
ActiveX object no longer has focus so any calls to access the
ActiveX object (i.e. using ObjectByName,
_ObjectCallMethod, etc) will fail and hardware alarms
will be triggered. To work around this, you need to change the Cicode focus back to the page containing the ActiveX object by using the WinSelect Cicode function. Please note that the Cicode focus is different from the visual / mouse focus. When the WinSelect function is used, there will be no visual change to the screen. The argument that you need to pass into the WinSelect function is the windows number of the page containing the ActiveX object, which will need to be captured using the WinNumber Cicode function. An example of how this can be carried out is: 1. Create a disk/memory/local variable tag to store the Windows Number. 2. On entering the parent page containing the ActiveX object, set this tag using the WinNumber Function. 3. On the pop-up page, call the WinSelect function prior to calling the ObjectByName function. |
Keywords: |
ActiveX, popup, pop-up, Unrecognised named object |
Related Links
Attachments