if I use DCHTMLVIEWER I loose control over Flash. Jimmy has sent me a sample without eXPress++ that works so far, but if I load swf file and play it, the control hangs after finishing.
Here is his code that works. Why does my eXPress++ code not work ? I see no difference on starting the ActiveX Control ?
I need to implement a flash flipbook swf in my eXPress++ application and buttons to browse through pictures.
Code: Select all
///////////////////////////////////////////////////////////////////////////////
//
// Vom Xbase++ FormDesigner generierter Klassen Code
// Erstellt am: 03.05.11 Zeit: 19:20:37
//
// Contents :
// Diese Datei enth„lt die Implementierungsebene eines Formulares und
// wird vom Xbase++ FormDesigner automatisch berschrieben. Sie sollte
// niemals editiert werden, da die Žnderungen verloren gehen k”nnten.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef _NEWFORM_
#define _NEWFORM_
#include "Gra.ch"
#include "Xbp.ch"
#include "Common.ch"
#include "Appevent.ch"
#include "Font.ch"
#PRAGMA LIBRARY( "ASCOM10.LIB" )
CLASS _NewForm FROM XbpDialog
EXPORTED:
VAR editControls
* Enthaltene Kontrollelemente
VAR oOFlash
VAR oPbOO
METHOD init
METHOD create
ENDCLASS
******************************************************************************
* Formular initialisieren
******************************************************************************
METHOD _NewForm:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
DEFAULT oParent TO AppDesktop(), ;
aPos TO {2,1}, ;
lVisible TO .F.
DEFAULT aPP TO {}
AAdd ( aPP, { XBP_PP_COMPOUNDNAME, "8.Arial" } )
IF Empty(aSize) == .T.
IF IsMemberVar(self,"ClientSize") == .T.
aSize := {0,0}
ELSE
aSize := {421,479}
ENDIF
ENDIF
::XbpDialog:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
IF aSize[1] == 0 .AND. aSize[2] == 0
::XbpDialog:ClientSize := {413,445}
ENDIF
::XbpDialog:taskList := .T.
::XbpDialog:title := "Neues Formular"
::editControls := {}
::oOFlash := XbpActiveXControl():new( ::drawingArea, , {8,60}, {396,376} )
::oOFlash:CLSID := "{D27CDB6E-AE6D-11cf-96B8-444553540000}"
::oOFlash:TabStop := .T.
::oPbOO := XbpPushButton():new( ::drawingArea, , {152,12}, {100,32}, { { XBP_PP_BGCLR, XBPSYSCLR_BUTTONMIDDLE }, { XBP_PP_FGCLR, -58 } } )
::oPbOO:caption := "load"
::oPbOO:tabStop := .T.
::oPbOO:activate := {|| NIL }
RETURN self
******************************************************************************
* Systemresourcen anfordern
******************************************************************************
METHOD _NewForm:create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::XbpDialog:create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::oOFlash:create()
::oPbOO:create()
RETURN self
#endif
//EOF
/////
#include "Gra.ch"
#include "Xbp.ch"
#include "Common.ch"
#include "Appevent.ch"
#include "Font.ch"
#pragma library("XppUi2")
PROCEDURE Appsys
RETURN
PROCEDURE Main
LOCAL nEvent, oXbp, mp1, mp2
LOCAL oDlg
oDlg := NewForm():New()
oDlg:oPbOO:activate := {|| oDlg:Load2() }
oDlg:Create()
CenterControl(oDlg)
SetAppWindow(oDlg)
SetAppFocus(oDlg)
SetAppFocus(oDlg:oPbOO)
nEvent := xbe_None
WHILE nEvent != xbeP_Close
nEvent := AppEvent ( @mp1, @mp2, @oXbp )
oXbp:HandleEvent ( nEvent, mp1, mp2 )
IF nEvent == xbeP_Quit
QUIT // AppQuit()
ENDIF
ENDDO
RETURN
CLASS NewForm FROM _NewForm
EXPORTED:
METHOD init
METHOD create
METHOD Load2
ENDCLASS
METHOD NewForm:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
::_NewForm:init( oParent, oOwner, aPos, aSize, aPP, lVisible )
RETURN self
METHOD NewForm:create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::_NewForm:create( oParent, oOwner, aPos, aSize, aPP, lVisible )
::show()
RETURN self
METHOD NewForm:Load2()
LOCAL oFileDlg, aFiles := {}
LOCAL aFilters := { {"Media Files","*.SWF"} }
oFileDlg := XbpFileDialog():new()
oFileDlg:fileFilters := aFilters
oFileDlg:center := .T.
oFileDlg:create( ::DrawingArea )
aFiles := oFileDlg:open(,.T.,.F.) // single
IF EMPTY(aFiles)
ELSE
::oOFlash:loadmovie(0,aFiles)
::oOFlash:play()
ENDIF
RETURN self
* Programmcode fr die Implementierungsebene der Klasse einfgen
#include "_FLASH.PRG"