Sign in to follow this  
Followers 0
dorit30

ObjCreate problem

19 posts in this topic

hi LiveX its a COMobject and The object is ocx

Cant figure what wrong i check if its reg , check if its Objct (IsObj)

The only diffrent is that VB use Button to active it

this what i get when i try :

==> The requested action with this object has failed.:

Visual Basic :

CODE
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

AxLiveX1.IpAddress = "127.0.01"

AxLiveX1.CommandPort = "4550"

AxLiveX1.DataPort = "5550"

AxLiveX1.AudioDataPort = "6550"

AxLiveX1.DisablePWD = True

AxLiveX1.UserName = "Bla"

AxLiveX1.Password = "BlaBla"

AxLiveX1.PlayX()

End Sub

CODE
$LiveX = ObjCreate("LiveX_v8200")

with $LiveX

.CommandPort = "4550"

.DataPort = "5550"

.AudioDataPort = "6550"

.IpAddress = "127.0.0.1"

.DisablePWD = True

.UserName = "Bla"

.Password = "BlaBla"

.PlayX()

EndWith

Share this post


Link to post
Share on other sites



Jump I

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Many COM objects do not work or work unexpectedly (w/o raising an error) when using the "With" structure in AutoIt. Until you are sure, preface each property/method with the object reference.

Instead of

with $LiveX
  .CommandPort = "4550"
  .DataPort = "5550"
etc., Try:
$LiveX.CommandPort = "4550"
$LiveX.DataPort = "5550"

Also, have you set up a COM error trap?

You can do it like by inserting this at the begining of your code:

Dim $oError
; Initializes COM handler
$oError = ObjEvent("AutoIt.Error", "ErrHandler")ƒoÝŠ÷ Ø    ÝŠw%¹×­†+žÊ&{^­è§Ê‹«r‡^jëhŠ×6Func ErrHandler()
  $HexNumber=Hex($oError.number,8)
  Msgbox(0, StringReplace( $oError.windescription, "error", "COM Error #") & $oError.Number, _
            $oError.Description & @CRLF & _
            "Source: "         & @TAB & $oError.source         & @CRLF & _
            "at Line #: " & $oError.ScriptLine & @TAB & _
            "Last DllError: " & @TAB & $oError.lastdllerror   & @CRLF & _
             "Help File: " & @TAB & $oError.helpfile & @TAB & "Context: " & @TAB & $oError.helpcontext _
            )
  SetError(1)  ; to check for after this function returns
Endfunc

This might provide more meaningful error descriptions.

Edited by DaRam

Share this post


Link to post
Share on other sites

First 10nx 4 the Error MsgBox ! verry useful BUT not here

I already use line by line no luCK AND the error tell me just in what Line its failed

I think i need a trigger 4 the Object like in VB the button thing , But i have no IDEA how to do this

Share this post


Link to post
Share on other sites

At which line of code does the error occur then? Beyond the COM object create?

First 10nx 4 the Error MsgBox ! verry useful BUT not here

I already use line by line no luCK AND the error tell me just in what Line its failed

I think i need a trigger 4 the Object like in VB the button thing , But i have no IDEA how to do this

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

At which line of code does the error occur then? Beyond the COM object create?

$oShell = ObjCreate("LiveX_v8200") ----> Load successfuly I check it with that :

$oShell = ObjCreate("LiveX_v8200")
if not IsObj($oShell) then
    Msgbox(0,"Error","$oShell is not an Object.")
else
    Msgbox(0,"Error","Successfully created Object $oShell.")
endif

So the answer is YES After the Object was Creat I got The Error

What i mean its when i try some method/properties like this :

$LiveX.CommandPort = "4550"

Error : The requested action with this object has failed.:

Edited by dorit30

Share this post


Link to post
Share on other sites

Jump II

Share this post


Link to post
Share on other sites

Jump II

Settle down, we all have day jobs you know? :)

Am I missing something, or should not:

$LiveX.CommandPort = "4550"

be:

$oShell = ObjCreate("LiveX_v8200")
$oShell.CommandPort = "4550"

Share this post


Link to post
Share on other sites

Settle down, we all have day jobs you know? :)

Am I missing something, or should not:

$LiveX.CommandPort = "4550"

be:

$oShell = ObjCreate("LiveX_v8200")
$oShell.CommandPort = "4550"
u can use this :

$LiveX = ObjCreate("LiveX_v8200")
$LiveX.CommandPort = "4550"

or this :

$oShell = ObjCreate("LiveX_v8200")
$oShell.CommandPort = "4550"

U know its the same

i just Show that i check it with :

$oShell = ObjCreate("LiveX_v8200")
if not IsObj($oShell) then
    Msgbox(0,"Error","$oShell is not an Object.")
else
    Msgbox(0,"Error","Successfully created Object $oShell.")
endif

Share this post


Link to post
Share on other sites

==> The requested action with this object has failed.:

you get the error when setting the properties? or does it fail on the .playx part?

Share this post


Link to post
Share on other sites

@OP

in VB, how was the Object "AxLiveX1" created?

Add Object

Share this post


Link to post
Share on other sites

The output from a COM error handler as described in the docs for ObjEvent could be very useful to you... doesn't appear you have tried this.

You can make this easy by using the one in IE.au3, even though you are not using its functions, like this:

#include <IE.au3>

_IEErrorHandlerRegister()

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

The output from a COM error handler as described in the docs for ObjEvent could be very useful to you... doesn't appear you have tried this.

You can make this easy by using the one in IE.au3, even though you are not using its functions, like this:

#include <IE.au3>

_IEErrorHandlerRegister()

Dale

Dear Dale i try it on this :

#include <IE.au3>

_IEErrorHandlerRegister()

$LiveX = ObjCreate("LiveX_v8200")

$LiveX.IpAddress = "127.0.0.1"

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

Result :

--> COM Error Encountered in Camera-ocx-take1.au3

----> $IEComErrorScriptline = 34

----> $IEComErrorNumberHex = 8000FFFF

----> $IEComErrorNumber = -2147418113

----> $IEComErrorWinDescription = Catastrophic failure

----> $IEComErrorDescription =

----> $IEComErrorSource =

----> $IEComErrorHelpFile =

----> $IEComErrorHelpContext =

----> $IEComErrorLastDllError = 0

i cant figure what the error

Edited by dorit30

Share this post


Link to post
Share on other sites

Final Jump

Share this post


Link to post
Share on other sites

Not much to offer I'm afraid. The error can be found in Google, but are few and typically apply to Database access.

I'm suggest that you see if you can replicate the error in VBScript and if so, take it to the vendor for support.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Not much to offer I'm afraid. The error can be found in Google, but are few and typically apply to Database access.

I'm suggest that you see if you can replicate the error in VBScript and if so, take it to the vendor for support.

Dale

In vb U need trigger 2 activate the ocx like a button mybe this is the problem ??? but how i do this in autOit

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