Page 1 of 2

ActiveX experiments

Posted: Fri Aug 08, 2008 11:54 pm
by esgici
Hi all

In version 2.5.1 ( at July 15, 2008 ) Roberto introduced a new control : ActiveX. IMHO this is one of most important
advancements in HMG. Running IE, WMPlayer, Flash Player and Acrobat Reader into my program, this is wonderful ! :shock:

I feel, with this new control there are many duties I can do. Roberto also give us examples (unfortunately only seven samples :( ). Problem is that I don't know almost anything ActiveX :(. From wasted years with VB left only hate in hand. "Do you want writing report?, use this .ocx !" Do you want open a table?, use this .ocx !" " Do you want build a list on a table?, use that .ocx !" " Do you want printing?, use that .ocx !"... etc.

Without understanding I may use a tool, but can't develop its usage. For example: in PROGID "shell.explorer.2" clause, what is meanings of "shell", "explorer" and "2" ? Does "explorer" stand for IE or Windows Explorer ? Instead of "2", can I specify 1, 3, 4, 5 ... and what will happen ?

This questions and similar ones are completely out of HMG. For responding an adequate Window Programing education is mandatory. I don't know there is anyone who have sufficent time for this.

The question I want to ask is : there isn't anyone experimented with ActiveX and want share with us :?:

Regards

Re: ActiveX experiments

Posted: Sat Aug 09, 2008 1:13 am
by luisvasquezcl
Hello Esgici,
I think your words represent the feelings of many in this group.
You're right that the ActiveX control opens a whole new range of possibilities; unfortunately just as you believe that there was much that we have no clear theme and we will have to be investigated in order to learn to use it.
I think that will investigate and share knowledge.
Sincerely

Luis Vasquez.

Re: ActiveX experiments

Posted: Sat Aug 09, 2008 3:57 am
by Rathinagiri
Rightly said Esgici.

ActiveX is like a black underground world. Whatever you get may seem to be gold, but it is not so. :)

It increases the possibilities, yes. And also it creates dependencies on other system files which might not have been installed in the user's system.

It is a long way to go.

Also, I heard that, ActiveX controls are more prone to viruses. Is it so?

Re: ActiveX experiments

Posted: Tue Nov 11, 2014 7:30 pm
by andyglezl
Demo.ACTIVEX.rar
(471.46 KiB) Downloaded 425 times
No se que pasó, pero parece que ya funciona...
---------------------------------------------------------------------
Do not know what happened, but it seems longer works ...

--------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: ActiveX experiments
Postby Rathinagiri » Sat Aug 09, 2008 3:57 am

Rightly said Esgici.

ActiveX is like a black underground world. Whatever you get may seem to be gold, but it is not so. :)

It increases the possibilities, yes. And also it creates dependencies on other system files which might not have been installed in the user's system.

It is a long way to go.

Also, I heard that, ActiveX controls are more prone to viruses. Is it so?
Bueno, estuve experimentando con el control ActiveX, y aquí les dejo un DEMO de lo que he visto.
( me enfoque mas en el RICHTEXTCTRL ). espero que les sea de utilidad y que entre todos sigamos mejorandolo.
--------------------------------------------------------------------------------------------------------------------------------------
Well, I experimented with the ActiveX control, and here I leave a DEMO of what I've seen.
(I focused more on the RichtextCtrl). hope you find it useful and that we all continue improving it.
ActiveX2.jpg
ActiveX2.jpg (344.32 KiB) Viewed 6742 times

Re: ActiveX experiments

Posted: Tue Nov 11, 2014 11:59 pm
by danielmaximiliano
Gracias por compartir ...
probando en 3. 2. 1......


1-11-2014- 21:15 compilacion ok. ejecucion con fallo... :cry:

la linea en cuestion es esta FormMain.RICHTEXT.Object:AutoVerbMenu:=.T.
Date:11/11/14 Time: 21:09:05
Error WINOLE/1008 No exported variable: AUTOVERBMENU (DOS Error -2147352570)

Called from TOLEAUTO:_AUTOVERBMENU(0)
Called from MAIN(35)
HMG.3.3.1 con patch 3 Windows 7 Home Premiun 64 bits.
la compilacion la hice en 32 bits.. voy a probar en 64 y comento...

Re: ActiveX experiments

Posted: Wed Nov 12, 2014 12:38 am
by danielmaximiliano
Hola Esgici y demas amigos de HMG.

no habia visto este tema pot algun motivo.... estoy utilizando un .ocx provisto por la empresa Hasar que vende impresoras fiscales en Argentina, estas impresoras son usadas por contribuyentes y queda registrada en su memoria interna por 10 años los datos que son impresos en el Ticket de venta de articulos...
yo usaba antes una libreria dinamica (.dll) provista por este mismo fabricante y hacia esto...

Code: Select all

#include 'hmg.ch'
Function Main 
public nHandler 
....
   If ( AbrirPuerto( .F. ) )     /* conecta la impresora a Comm1 */
       Principal.Center
       Principal.Activate
   Endif
....
Return

*-------------------------------------------------------------*
Function AbrirPuerto( lRetorno )
*-------------------------------------------------------------*
nHandler := CallDll32( "OpenComFiscal" , "WINFIS32.DLL" , 1 , 0 )

    If nHandler >= 0 
       Principal.StatusBar.Item(2) :="Puerto de impresora OK "
       nError := CallDll32( "InitFiscal"    , "WINFIS32.DLL" , nHandler )
       If nError = 0
         lRetorno :=  .T.
       Else 
         alerror( nError )
         Principal.StatusBar.Item(2) := " La impresora no se puede Inicializar"   
          lRetorno := .T.  
       Endif
   Else
    alerror( nHandler )
    Principal.StatusBar.Item(2) :=" Hubo un error de abrir puerto Comm "
    lRetorno := .T.      
   Endif

Return ( lRetorno )
al utilizar el componetes COM+ (.ocx) se utiliza de esta manera..

Code: Select all

#include 'hmg.ch'

#define c715F 'HASAR.Fiscal.1'
Function Main
Public  o715F 
Crea715f( )
....
...
Return 

*------------------------------------------------------------------------------*
Function Crea715f( )
*------------------------------------------------------------------------------*
Return
    IF ( o715F := CreateObject( c715F ) ) != NIL
       o715F:puerto := 1
	   If ( cModelo := o715F:AutodetectarModelo( ) ) != NIL
		      PrincipalOCX.STATUSBAR.Item(2) := 'Impresora ' + Alltrim ( cModelo ) + ' Conectada a  ' + ;
			                                     Alltrim ( STR ( nPuerto ) )
		    else 	
			  PrincipalOCX.STATUSBAR.Item(2) := 'Impresora desconocida ' + ' Conectada a COM1 ' 
       EndIf
    Else
		Msgbox ( ' No se puede inicializar la IMPRESORA ' , ' Mensaje de error !!! ' )
    endIf				   
no he notado diferencias en velocidad de ejecucion sino simplicidad en la comunicacion en todos los metodos asociados al objeto que encapsula el .ocx
igualemente tanto el .dll y el .ocx necesita estar registrado en Windows ....

Re: ActiveX experiments

Posted: Wed Nov 12, 2014 1:08 am
by andyglezl
Hola Max, se supone que esta linea te muestra el menu contextual.
Si la pones como comentario a ver que pasa ?
----------------------------------------------------------------------------------
Hi Max, this line is supposed to show you the shortcut menu.
If you put it as a comment and see what happens?

ActiveX3.jpg
ActiveX3.jpg (245.62 KiB) Viewed 6691 times
Yo estoy utilizando HMG.3.3.1 con patch 3 Windows 7 PRO 32 bits.

Re: ActiveX experiments

Posted: Wed Nov 12, 2014 1:26 am
by danielmaximiliano
Hola Andres...
sigue con la linea siguiente el error... ahora da linea 36 y hay esto

Code: Select all

_DefineActivex("RICHTEXT", "FormMain", 295, 000, 660, 410, "RICHTEXT.RichtextCtrl" )				//  OK
	//	FormMain.RICHTEXT.Object:AutoVerbMenu:=.T.  // Cut, Copy, Paste    									//  OK
		FormMain.RICHTEXT.Object:LoadFile( "SPA.rtf", 0 ) // 0=RTF File  1= Tex File   
debe ser error del activeX RichTEXT que no debe existir en mi maquina.. mañaña voy a buscar info
igual gracias

Re: ActiveX experiments

Posted: Wed Nov 12, 2014 2:11 am
by andyglezl
guiado por la lógica, creo que se deberá tener instalado el FLASH PLAYER, IEXPLORER y OFFICE
para poder probarlo.
------------------------------------------------------------------------------------------------------------------
guided by logic, I think you should have installed FLASH PLAYER, IEXPLORER and OFFICE to try.

Re: ActiveX experiments

Posted: Wed Nov 12, 2014 8:57 am
by Agil Abdullah
Hi Andy,

Excellent demo.... Thanks.
--------------------------------------------------------------------------------------------------------

Hi Daniel,

I Don't speak Spanish/Portugese, could you explain what you were discussing?... Thanks