Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Problem with ShockwaveFlash object !


  • Please log in to reply
17 replies to this topic

#1 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 18 May 2012 - 12:07 PM

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?

Attached Thumbnails

  • error.JPG








#2 Mallie99

Mallie99

    Wayfarer

  • Active Members
  • Pip
  • 67 posts

Posted 18 May 2012 - 12:12 PM

Would you use objGet to use a second instance?
Are you telling me something I need to know or something I want to know?

#3 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 18 May 2012 - 12:14 PM

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

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#4 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 18 May 2012 - 10:41 PM

here is the full script:

AutoIt         
#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, 18 May 2012 - 10:44 PM.


#5 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 19 May 2012 - 07:04 AM

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

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#6 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 19 May 2012 - 04:04 PM

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!

AutoIt         
#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!

#7 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 19 May 2012 - 04:19 PM

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:
AutoIt         
#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, 20 May 2012 - 11:28 AM.

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#8 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 20 May 2012 - 09:20 AM

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!

#9 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 20 May 2012 - 09:28 AM

What version of AutoIt do you run?

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#10 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 20 May 2012 - 11:25 AM

AutoIt Version: 3.3.6.1

#11 wakillon

wakillon

    Tiny Tools Coder

  • Active Members
  • PipPipPipPipPipPip
  • 2,841 posts

Posted 20 May 2012 - 11:29 AM

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

       AutoIt Version : 3.3.12.0 / Beta 3.3.13.8 SciTE 3.4.1 OS:WIN7/WIN8.1 CPU:X64 OS:X64


#12 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 20 May 2012 - 11:29 AM

I modfied my code in post #7. I hope it will now return some useful error information.
Could you please re-run my code and post the result?

Edited by water, 20 May 2012 - 11:30 AM.

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#13 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 20 May 2012 - 12:05 PM

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:

#14 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 20 May 2012 - 12:24 PM

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.

#15 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 20 May 2012 - 12:35 PM

Here is another thread using Flash player.
Could you please replace all occurrences of "ShockwaveFlash.ShockwaveFlash" in your with "ShockwaveFlash" and test again.

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#16 water

water

    ?

  • MVPs
  • 15,070 posts

Posted 20 May 2012 - 12:39 PM

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

UDFs:
Active Directory (NEW 2014-07-21 - Version 1.4.1.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2013-11-10 - Version 0.10.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2013-01-21 - Version 0.3.1.1) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:

ADO - Wiki


#17 wakillon

wakillon

    Tiny Tools Coder

  • Active Members
  • PipPipPipPipPipPip
  • 2,841 posts

Posted 20 May 2012 - 12:43 PM

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 Version : 3.3.12.0 / Beta 3.3.13.8 SciTE 3.4.1 OS:WIN7/WIN8.1 CPU:X64 OS:X64


#18 SYRAU3

SYRAU3

    Wayfarer

  • Banned (NOT IN USE)
  • 98 posts

Posted 20 May 2012 - 01:58 PM

Here is another thread 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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users