FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Dialog Redefine y ActiveX
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Dialog Redefine y ActiveX
Posted: Tue Apr 21, 2009 01:47 PM

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.

Saludos desde Mallorca
Biel Maim贸
http://bielsys.blogspot.com/
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: Dialog Redefine y ActiveX
Posted: Tue Apr 21, 2009 01:58 PM
Biel,

Prueba,

Code (fw): Select all Collapse
oDlg:bInit := {|| Redeineix el control ActiveX }


Siau.
Salutacions, saludos, regards

"...programar es f谩cil, hacer programas es dif铆cil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Dialog Redefine y ActiveX
Posted: Tue Apr 21, 2009 02:17 PM
Hello Biel

I use your code for Axis in a Dialog :

Code (fw): Select all Collapse
#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 nil


Regards Maurizio
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: Dialog Redefine y ActiveX
Posted: Tue Apr 21, 2009 02:47 PM
Carles wrote:Biel,

Prueba,

Code (fw): Select all Collapse
oDlg:bInit := {|| Redeineix el control ActiveX }


Siau.

Hola Carles com estas?
Tal como comentas no me funciona, da error en el activate del dialogo. Para otras cosas si que es el lugar donde ponerlo, pero para REDEFINES no me pita.
Maurizio wrote:Hello Biel

I use your code for Axis in a Dialog :
...
Regards Maurizio

Hi Maurizio, yes I know is running, I also use it with the Axis ActiveX, but what I can't understand is why is running ok, as you see in the REDEFINE your are passing the oDlg "OF oDlg", and really oDlg it's nil at that time.

Now I'm testing another Activex and its diaplaying anything if I do via REDEFINE, and is running ok if I create dynamically on INIT. But on INIT I can't redefine, so I must put size and position at creation time, Will be more easey to paint on Resource and then making the redefiniton.
Saludos desde Mallorca
Biel Maim贸
http://bielsys.blogspot.com/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Dialog Redefine y ActiveX
Posted: Wed Apr 22, 2009 02:00 AM

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.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: Dialog Redefine y ActiveX
Posted: Thu Apr 23, 2009 05:08 PM
Hola Antonio,
el control es freeware, http://www.ea6dd.com/ftp/XMMT.ocx
Definiendo los controles de forma dinamica, funciona ok
Code (fw): Select all Collapse
#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 NIL


Y lo intento usar desde recursos con el siguiente c贸digo
Code (fw): Select all Collapse
FUNCTION 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 NIL

El fichero RC lo tengo definido tal cual sigue.
Code (fw): Select all Collapse
MMTTY 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
END
Saludos desde Mallorca
Biel Maim贸
http://bielsys.blogspot.com/
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: Dialog Redefine y ActiveX
Posted: Tue Apr 06, 2010 03:59 PM

Hola 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.

Saludos desde Mallorca
Biel Maim贸
http://bielsys.blogspot.com/

Continue the discussion