ActiveX experiments

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
esgici
Posts: 4502
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 372 times
Been thanked: 111 times
Contact:

ActiveX experiments

Post by esgici » Fri Aug 08, 2008 11:54 pm

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
Last edited by esgici on Sat Aug 09, 2008 2:47 am, edited 1 time in total.
Viva INTERNATIONAL HMG :D

User avatar
luisvasquezcl
Posts: 1137
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 14 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Sat Aug 09, 2008 1:13 am

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.

User avatar
Rathinagiri
Posts: 5262
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 167 times
Been thanked: 172 times
Contact:

Post by 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?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
andyglezl
Posts: 1140
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 68 times
Contact:

Post by andyglezl » Tue Nov 11, 2014 7:30 pm

Demo.ACTIVEX.rar
(471.46 KiB) Downloaded 215 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 3004 times
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
danielmaximiliano
Posts: 2105
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 128 times
Been thanked: 16 times
Contact:

Post by danielmaximiliano » Tue Nov 11, 2014 11:59 pm

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...
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
danielmaximiliano
Posts: 2105
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 128 times
Been thanked: 16 times
Contact:

Post by danielmaximiliano » Wed Nov 12, 2014 12:38 am

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 ....
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
andyglezl
Posts: 1140
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 68 times
Contact:

Post by andyglezl » Wed Nov 12, 2014 1:08 am

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 2953 times
Yo estoy utilizando HMG.3.3.1 con patch 3 Windows 7 PRO 32 bits.
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
danielmaximiliano
Posts: 2105
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 128 times
Been thanked: 16 times
Contact:

Post by danielmaximiliano » Wed Nov 12, 2014 1:26 am

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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
andyglezl
Posts: 1140
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 68 times
Contact:

Post by andyglezl » Wed Nov 12, 2014 2:11 am

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.
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Post by Agil Abdullah » Wed Nov 12, 2014 8:57 am

Hi Andy,

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

Hi Daniel,

I Don't speak Spanish/Portugese, could you explain what you were discussing?... Thanks
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender

Post Reply