Sign in to follow this  
Followers 0
vanowm

The requested action with this object has failed

3 posts in this topic

#1 ·  Posted (edited)

Hello!

I'm trying use Skype API via Skype4COM.dll and so far everything works fine, except for one thing: whenever I start skype via the skype4com object I have to put the script in sleep for a few seconds until skype fully started, because if I don't do that, script dies with the error message Posted Image

Why in the world AU3 would kill the script instead of put error code into @Error or something is beyond my very limited understanding...

Here is the code:

$oSkype = ObjCreate("Skype4COM.Skype")
$oSkype.Client.Start()

; Wait untill skype is started
While NOT $oSkype.Client.IsRunning
    Sleep(1)
Wend

;Sleep(5000)
; Connect to the Skype API:
$oSkype.Attach

Exit

As you can see, the script will "pause" until skype is started, that part is working, but apparently there is a few seconds gap before skype is able accept plugin attachments after its started...and that gap will probably vary depend on system speed...

So, anyway avoid this problem without placing the script into sleep? (sleep is only a work around and not 100% error proof in this case)

Thank you.

Edited by vanowm

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Add the COM Error Handling in your script and you get what you are asking.

Its documented quite well in the Helpfile. :)

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

That's it! Thank you very much :)

Problem solved :)

P.S. here is a working example on how it could be done:

Edited by vanowm

Share this post


Link to post
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
Sign in to follow this  
Followers 0