Jump to content

error object


Recommended Posts

hi! I am trying to use the skype API, but one particular give me a error.

if i write this it's all ok:

;Create a Skype4COM object:
 $oSkype = ObjCreate("Skype4COM.Skype")
 $SinkObject=ObjEvent($oSkype,"Skype_") 
  Call status events:
 Func Skype_CallStatus($oCall, $Status)
   MsgBox(0, "Call" , "Call " & $oCall.Id & " status " & $oSkype.Convert.CallStatusToText($Status))
 EndFunc

but i want know if skype is running, and i must use the api isRunning:

[id(0x00000004), propget, helpstring("Returns Skype application running status."), helpcontext(0x00000024)]

VARIANT_BOOL IsRunning();

-----------------------------------------------------------------------------------------------------

HRESULT IClient::IsRunning ( [out, retval] VARIANT_BOOL * pVal )

This command queries the running status of the Skype client.

Parameters:

[out] pVal receives the VARIANT_TRUE value if the Skype client is running.

-----------------------------------------------------------------------------------------------------

a example in VB:

If Not oSkype.Client.IsRunning Then oSkype.Client.Start() End If

in skype i write:

If $oSkype.Client.IsRunning Then
;Place a call to echo123:
 $oCall = $oSkype.PlaceCall("echo123")
 EndIf

or

;If $oSkype.Client.IsRunning Then 
;    $oSkype.Client.Start() 
;EndIf

all two give me a error!

can you help me?

Link to comment
Share on other sites

  • Moderators

See what this gives you:

$oSkype = ObjCreate("Skype4COM.Skype")

If IsObj($oSkype) Then
    If $oSkype.Client.IsRunning Then
        MsgBox(0, "", "Skype is currently running.")
    Else
        If MsgBox(4, "", "Skype is not currently running." & @CRLF & @CRLF & _
                "Would you like to start it?") = 6 Then
            $oSkype.Client.Start ()
        EndIf
    EndIf
Else
    MsgBox(48, "Error", "Could not create object 'Skype'.")
EndIf
Link to comment
Share on other sites

See what this gives you:

....

i have tried this:

If IsObj($oSkype) Then
     MsgBox(0, "", "is object")
    If $oSkype.Client.IsRunning Then
        MsgBox(0, "", "Skype is currently running.")
    Else
        If MsgBox(4, "", "Skype is not currently running." & @CRLF & @CRLF & _
                "Would you like to start it?") = 6 Then
            $oSkype.Client.Start ()
        EndIf
    EndIf
Else
    MsgBox(48, "Error", "Could not create object 'Skype'.")
EndIf

but show popup "is object" after give error to signal to Microsoft:

AppName: autoit3.exe AppVer: 3.1.1.126 ModName: autoit3.exe

ModVer: 3.1.1.126 Offset: 00020835

note: i use beta run! maybe is a autoit bug for VARIANT_BOOL?

Link to comment
Share on other sites

See what this gives you:

$oSkype = ObjCreate("Skype4COM.Skype")

If IsObj($oSkype) Then
    If $oSkype.Client.IsRunning Then
        MsgBox(0, "", "Skype is currently running.")
    Else
        If MsgBox(4, "", "Skype is not currently running." & @CRLF & @CRLF & _
                "Would you like to start it?") = 6 Then
            $oSkype.Client.Start ()
        EndIf
    EndIf
Else
    MsgBox(48, "Error", "Could not create object 'Skype'.")
EndIf
In your example, $oSkype.Client.Start() is only attempted after determining that $oSkype is NOT an object, so I wouldn't think that could work. Maybe insert some code to Run() the executable for Skype, wait for it to come up, and try again? :D

Edit: Or NOT... I misread it... :">

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...