Jump to content

IUIAutomation error with $objUIAutomation


Recommended Posts

Hi all

Im working with sample code from this page:

'?do=embed' frameborder='0' data-embedContent>>

The example code is 

The error i get when run this code is:

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
matched: class30012
Matching: 30012 for CalcFrame
"C:\Program Files\AutoIt3\Include\UIAWrappers.au3" (553) : ==> Variable must be of type "Object".:
$objUIAutomation.createPropertyCondition($PropertyId, $tVal, $pCondition)
$objUIAutomation^ ERROR
->21:51:53 AutoIt3.exe ended.rc:1
+>21:51:53 AutoIt3Wrapper Finished..

Please help

Thanks

Link to comment
Share on other sites

I have downloaded and run the example right now. I'm not getting any errors.

In top of the script Calculator and Notepad are opened. Can you see if these programs are opened. If not just comment out these two lines and open the programs yourself.

Link to comment
Share on other sites

Add a check to make sure that the variable is an object, prior to using properties|methods

IsObj

you might need to add a loop to wait for it to be an object

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

I have downloaded and run the example right now. I'm not getting any errors.

In top of the script Calculator and Notepad are opened. Can you see if these programs are opened. If not just comment out these two lines and open the programs yourself.

 

Add a check to make sure that the variable is an object, prior to using properties|methods

IsObj

you might need to add a loop to wait for it to be an object

Hi i've check in UIAWrappers.au3 and found that the script can not create object

func _UIA_Init()
;~  consolewrite("initializing")
    ;~ The main object with acces to the windows automation api 3.0
    $objUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation)
    If IsObj($objUIAutomation) = 0 Then
        msgbox(1,"UI automation failed", "UI Automation failed",10)
        Return SetError(1, 0, 0)
    EndIf

$objUIAutomation = 0 so it's not a object. Im using Autoit version 3.3.10.2. What should i do now?

Edited by luckyluke
Link to comment
Share on other sites

What platform are you on? This should run from XP SP3 to Win 8. If you are on XP or Vista there may be a risk that the API isn't installed. See http://support.microsoft.com/kb/971513. Can you verify that UIAutomationCore.dll is installed on your system?

Link to comment
Share on other sites

What platform are you on? This should run from XP SP3 to Win 8. If you are on XP or Vista there may be a risk that the API isn't installed. See http://support.microsoft.com/kb/971513. Can you verify that UIAutomationCore.dll is installed on your system?

Hi, im using XP SP3. I've searched for UIAutomationCore.dll and found it in system32 folder, so i think it's installed

Link to comment
Share on other sites

I have just tested on my old XP SP3. It works.

luckyluke, It seems as if UI Automation isn't working on your PC. You can try to install the UI Automation update in the link, and you can try to update everything on your PC with Microsoft Update, if you haven't done that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...