Tengo una duda existencial,
si el handler del diaolo se crea al iniciarse, como se pueden redefiner controles ActvieX en un dialog, en el momento de ejecutar el Redefine, el dialogo todavia no esta creado.
Tengo una duda existencial,
si el handler del diaolo se crea al iniciarse, como se pueden redefiner controles ActvieX en un dialog, en el momento de ejecutar el Redefine, el dialogo todavia no esta creado.
#include "FiveWin.ch"
static oAxis
function Main()
Local nFormat:=0 //0->jpg, 1->BMP
Local cFile:='c:\image.jpg'
local oDlg
DEFINE DIALOG oDlg RESOURCE "map"
REDEFINE ACTIVEX oAxis ID 100 OF oDlg PROGID "AxisMediaControl.AxisMediaControl.1"
REDEFINE BUTTON ID 1 OF oDlg ACTION (oAxis:Do("SaveCurrentImage",nFormat,cFile) )
ACTIVATE DIALOG oDlg CENTERED ON INIT Show(OdLG)
oaxis:Destroy()
return nil
//--------------------------------------------------------------------------------------------
Function Show(OdLG)
WITH OBJECT oAxis
:SetProp("MediaUrl","http://xxx.xxx.xxx.xxx/axis-cgi/mjpg/video.cgi") //Cambiar por direcci贸n IP
:SetProp("MediaType", "mjpeg-unicast")
:SetProp("MediaUserName","root") //si se usa proteccion por contrase帽a
:SetProp("MediaPassWord","pass")
:DO("PLAY")
inkey(0.5)
END
oDlg:oClient:=oAxis
return nilCarles wrote:Biel,
Prueba,
oDlg:bInit := {|| Redeineix el control ActiveX }
Siau.
Maurizio wrote:Hello Biel
I use your code for Axis in a Dialog :
...
Regards Maurizio
Biel,
> Now I'm testing another Activex and its diaplaying anything if I do via REDEFINE
What ActiveX is it ? Is there a demo version to test it ? How is defined in the resource ?
An ActiveX control is a kind of a user defined control, same as we use xbrowse, BtnBmp, TImage, etc. They get initialized when the dialog is initialized. Aditionally the ActiveX control creates another windows control, using its own engine, that is placed on top of the user defined control.
Que ActiveX es ? Hay una versi贸n demo que podamos probar ? Como lo defines en el recurso ?
Un control ActiveX es un tipo m谩s de control definido por el usuario, igual que los xbrowse, BtnBmp, TImage, etc. Se inicializan cuando el di谩logo se incializa. Adicionalmente el control ActiveX crea otro control de windows, usando su propio motor, que es situado encima del control definido por el usuario.
#include "FiveWin.ch"
#define RXM_SHOWSETUP 13
STATIC oMmr
FUNCTION mmTty()
LOCAL oDlg
MsgInfo('Pruebas preliminares con MMTTY Engine, no es funcional todavia')
DEFINE DIALOG oDlg
@ 03,0 BUTTON oBtn1 PROMPT "setup" ACTION oMmr:DO("PostMmttyMessage", RXM_SHOWSETUP, 0)
@ 03,10 BUTTON oBtn2 PROMPT "TX" ACTION oMmr:SetProp('ptt',.T.)
@ 03,20 BUTTON oBtn3 PROMPT "RX" ACTION oMmr:SetProp('ptt',.f.)
ACTIVATE DIALOG oDlg ON INIT IniMmTty(oDlg) //NOWAIT
RETURN NIL
//--------------------------------------------
STATIC FUNCTION IniMmTty(oDlg)
LOCAL oMmlvl,oMmSpec
oMmr:=tActiveX():New(oDlg,'XMMR.XMMRCtrl.1',0,0,1,1)
oMmlvl:=tActiveX():New(oDlg,'XMMLVL.XMMLvlCtrl.1',1,1,50,50)
oMmSpec:=tActiveX():New(oDlg,'XMMLVL.XMMSpecCtrl.1',1,60,160,60)
oMmr:SetProp('bActive',.T.)
RETURN NILFUNCTION mmTty()
LOCAL oDlg
DEFINE DIALOG oDlg RESOURCE "MMTTY"
REDEFINE ACTIVEX oMmr ID 500 OF oDlg PROGID "XMMR.XMMRCtrl.1"
REDEFINE ACTIVEX oMmlvl ID 501 OF oDlg PROGID 'XMMLVL.XMMLvlCtrl.1'
REDEFINE ACTIVEX oMmlvl ID 502 OF oDlg PROGID 'XMMLVL.XMMSpecCtrl.1'
REDEFINE BUTTON ID 700 ACTION oMmr:DO("PostMmttyMessage", RXM_SHOWSETUP, 0)
REDEFINE BUTTON ID 701 ACTION oMmr:SetProp('ptt',.T.)
REDEFINE BUTTON ID 702 ACTION oMmr:SetProp('ptt',.f.)
ACTIVATE DIALOG oDlg ON INIT oMmr:SetProp('bActive',.T.)
RETURN NILMMTTY DIALOGEX DISCARDABLE 6, 18, 258, 142
STYLE WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "MS Sans Serif", 0, 0, 1
BEGIN
CONTROL "Custom control", 500, "tActivex", 0x00000000, 4, 4, 136, 40
CONTROL "SetUp", 700, "Button", WS_TABSTOP, 192, 76, 45, 15
CONTROL "Custom control", 501, "tActivex", 0x00000000, 12, 52, 136, 40
CONTROL "Custom control", 502, "tActivex", 0x00000000, 20, 96, 136, 40
CONTROL "TX", 701, "Button", WS_TABSTOP, 192, 96, 45, 15
CONTROL "RX", 702, "Button", WS_TABSTOP, 196, 116, 45, 15
ENDHola Antonio, este es un viejo post. Tenia el tema abandonado, pero ahora me interesa retomarlo. En el mensaje anterior te pongo un enlace para descargar el activex. El problema que tengo es al intentar usarlo desde recurosos, no consigo que funcione.
Saludos y gracias anticipadas.