Sign in to follow this  
Followers 0

Problem with ShockwaveFlash object !

18 posts in this topic

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

Share this post


Link to post
Share on other sites



Posted

Would you use objGet to use a second instance?

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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")

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Posted

What version of AutoIt do you run?

Share this post


Link to post
Share on other sites

Posted

AutoIt Version: 3.3.6.1

Share this post


Link to post
Share on other sites

Posted

May be it's Flash Player who is not correctly installed or updated...

Try to Uninstall Flash Player with their official unInstaller.

restart your PC in safe mode

and install latest version.

;)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Posted

Here is another using Flash player.

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

Share this post


Link to post
Share on other sites

Posted

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

Share this post


Link to post
Share on other sites

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 ! ;)

Share this post


Link to post
Share on other sites

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.

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

  • Recently Browsing   0 members

    No registered users viewing this page.