Jump to content

Recommended Posts

Posted

hello all, this problem is making me sick, when a GUI with a ShockwaveFlash object is running, i cant run another GUI with ShockwaveFlash object at the same time, when i run the second GUI i get the message that the var is not an object and i can't use "with":

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$FlashCtrl = GUICtrlCreateObj($oFlash, -1, 0, 852, 600)
    With $oFlash
        .Movie = @scriptDir & '\movie.swf'
        .bgcolor = "#aaaaaa"
        .ScaleMode = 0
        .wmode = "transparent"
        .wmode = "opaque"
        .zoom(50)
        .Menu = False
        .AlignMode = 0
    EndWith

D:\Projects\SWF Movie.au3 (86) : ==> Only Object-type variables allowed in a "With" statement.:

With $oFlash

With ^ ERROR

but if the first GUI is closed, the second never works again and i receive the same message up there, untill i restart Windows, i thought that the object is still created because when i run FlashPlayer Installer i get this message: (Attached with the topic down there).

but im sure the GUI process is not running, and there is no other flash objects in any windows are running, i found somewhere.. that making $oFlash = 0 will delete the object, so i put this command before the exiting command, but nothing changed, and i'm sure there is no errors with my simple script, any help please?

post-60364-0-97693300-1337342828_thumb.j

Posted

Do you get any error message by your COM error handler?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

here is the full script:

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Global $oFlash
Global $fError = False
_IEErrorHandlerRegister()

HotKeySet("{ESC}", "_Close")
$hGUI = GUICreate("READER", 850, 625)
GUISetBkColor(0xFFFFFF)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 850, 600)
GUICtrlSetState(-1, $GUI_HIDE)
$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$FlashCtrl = GUICtrlCreateObj($oFlash, -1, 0, 852, 600)
GUICtrlSetResizing(-1, $GUI_DOCKHCENTER + $GUI_DOCKWIDTH)
GUICtrlCreateGraphic(0, 600, 850, 1)
GUICtrlSetColor(-1, 0x000000)
With $oFlash
.Movie = @ScriptDir & 'file.swf'
.bgcolor = "#aaaaaa"
.ScaleMode = 0
.wmode = "transparent"
.wmode = "opaque"
.zoom(50)
.Menu = False
.AlignMode = 0
EndWith
GUISetState(@SW_SHOW)



While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   _Close()
EndSwitch
WEnd

Func _Close()
$oFlash.Stop()
$oFlash = 0
Exit
EndFunc   ;==>_Close
Func COMError()
$fError = True
EndFunc   ;==>COMError

for example, it gives me the same error when Yahoo Messenger or WIndows lIve messenger is running! or when the saame script runs twice, i'm not sure this problem is in Windows XP too, but i used 2 different Windows 7 versions, and i got the same error!!

Edited by SYRAU3
Posted

You could test if Flash is already running. If yes, connect to it, if no, create the application:

$oFlash = ObjGet("", "ShockwaveFlash.ShockwaveFlash")
If @error Then $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

the problem is still alive:

i checked if it the object is already created and i replaced "with" with the vars directly, the same problem, the object is not being created!

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Global $oFlash
Global $fError = False
_IEErrorHandlerRegister()

HotKeySet("{ESC}", "_Close")
$hGUI = GUICreate("READER", 850, 625)
GUISetBkColor(0xFFFFFF)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 850, 600)
GUICtrlSetState(-1, $GUI_HIDE)
$oFlash = ObjGet("", "ShockwaveFlash.ShockwaveFlash")
If @error Then
$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
EndIf
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$FlashCtrl = GUICtrlCreateObj($oFlash, -1, 0, 852, 600)
GUICtrlSetResizing(-1, $GUI_DOCKHCENTER + $GUI_DOCKWIDTH)
GUICtrlCreateGraphic(0, 600, 850, 1)
GUICtrlSetColor(-1, 0x000000)
  $oFlash.Movie = @ScriptDir & 'file.swf'
  $oFlash.bgcolor = "#aaaaaa"
  $oFlash.ScaleMode = 0
  $oFlash.wmode = "transparent"
  $oFlash.wmode = "opaque"
  $oFlash.zoom(50)
  $oFlash.Menu = False
  $oFlash.AlignMode = 0

GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   _Close()
EndSwitch
WEnd

Func _Close()
$oFlash.Stop()
$oFlash = 0
Exit
EndFunc   ;==>_Close
Func COMError()
$fError = True
EndFunc   ;==>COMError

sometimes i can run Flash Player installer and it fixes the problem, but that's not available all the time!

Posted (edited)

You register the IE COM error handler by calling _IEErrorHandlerRegister(). Then you overwrite the COM error handler by this line:

$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
The error handler you call does nothing.

You need something like this:

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Global $oFlash
Global $fError = False
$oError = ObjEvent("AutoIt.Error", "COMError")
HotKeySet("{ESC}", "_Close")
$hGUI = GUICreate("READER", 850, 625)
GUISetBkColor(0xFFFFFF)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 850, 600)
GUICtrlSetState(-1, $GUI_HIDE)
$oFlash = ObjGet("", "ShockwaveFlash.ShockwaveFlash")
If @error Then
$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
EndIf
$FlashCtrl = GUICtrlCreateObj($oFlash, -1, 0, 852, 600)
GUICtrlSetResizing(-1, $GUI_DOCKHCENTER + $GUI_DOCKWIDTH)
GUICtrlCreateGraphic(0, 600, 850, 1)
GUICtrlSetColor(-1, 0x000000)
  $oFlash.Movie = @ScriptDir & 'file.swf'
  $oFlash.bgcolor = "#aaaaaa"
  $oFlash.ScaleMode = 0
  $oFlash.wmode = "transparent"
  $oFlash.wmode = "opaque"
  $oFlash.zoom(50)
  $oFlash.Menu = False
  $oFlash.AlignMode = 0

GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   _Close()
EndSwitch
WEnd

Func _Close()
$oFlash.Stop()
$oFlash = 0
Exit
EndFunc   ;==>_Close
Func COMError()
    ConsoleWrite("err.number is: " & @TAB & $oError.number & @CRLF & _
            "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            "err.description is: " & @TAB & $oError.description & @CRLF & _
            "err.source is: " & @TAB & $oError.source & @CRLF & _
            "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF)
EndFunc   ;==>COMError
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Yes, you are right, this is what the console returned:

err.number is:     0

err.windescription:    0

err.description is:     0

err.source is:     0

err.helpfile is:     0

err.helpcontext is:     0

err.lastdllerror is:     0

err.scriptline is:     0

err.retcode is:     0

even so, the problem is still alive ;)

Please help.. BIG MINDS!

Posted

What version of AutoIt do you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted (edited)

I modfied my code in post I hope it will now return some useful error information.

Could you please re-run my code and post the result?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Flash playes is installed perfectly, this is what the console returned:

err.number is: -2147221005

err.windescription: Invalid class string

err.description is:

err.source is:

err.helpfile is:

err.helpcontext is:

err.lastdllerror is: 1008

err.scriptline is: 16

err.retcode is:

err.number is: -1

err.windescription: The operation completed successfully.

err.description is:

err.source is:

err.helpfile is:

err.helpcontext is:

err.lastdllerror is: 0

err.scriptline is: 18

err.retcode is:

err.number is: 169

err.windescription: Variable must be of type 'Object'.

err.description is:

err.source is:

err.helpfile is:

err.helpcontext is:

err.lastdllerror is: 0

err.scriptline is: 22

err.retcode is:

Posted

I solved the big stupid problem thank you, it was because of the flash player checking func, i had to use ProcessWaitClose("") not to create the object while flash player is installing is the silent mode.

thanks for your help MR. water, and everyone ;)

If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\READER", "") = "1" Or @error Then
        FileInstall("fpax103.exe", @TempDir & "\fpax103.exe", 1)
        Run(@TempDir & "\fpax103.exe /install")
        ProcessWaitClose("fpax103.exe")
        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\READER", "", "REG_SZ", "0")
    EndIf

Godspeed.

Posted

Here is another using Flash player.

Could you please replace all occurrences of "ShockwaveFlash.ShockwaveFlash" in your with "ShockwaveFlash" and test again.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Oh, I'm glad you could solve your problem ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

Flash playes is installed perfectly, this is what the console returned:

so it was well Flash Player who was not correctly installed !

Use RunWait instead of Run ! ;)

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Posted

Here is another using Flash player.

Could you please replace all occurrences of "ShockwaveFlash.ShockwaveFlash" in your with "ShockwaveFlash" and test again.

NEVER WORKED!

Oh, I'm glad you could solve your problem Posted Image

Hahahaha ME TOOOO!

so it was well Flash Player who was not correctly installed !

Use RunWait instead of Run ! Posted Image

OPPS! not perfectly ;) thanks you bro.

i will, thanks again.

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
  • Recently Browsing   0 members

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