Mixed mode fails

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

arturoorta
Posts: 14
Joined: Fri Jan 25, 2013 8:19 pm
Has thanked: 1 time

Mixed mode fails

Post by arturoorta »

Hello everyone.

I have this problem. I ported an old system from clipper to HMG. The problem is as follow: when I compiled with 3.0.46 everything runs fine. I changed my report generator to present the results with hmg windows printng system. All Ok, no problem. After 2 or 3 year, I needed to update the system with more functionality. Upgraded HMG to 3.4.4 Stable and compiled without problems. But now, when the system generates a report via DOS box, the report window open and after seconds or minutes the system crashes with an "argument error ==". I checked the printing system code but I don't found the error. I have another system made completely with windows not mixed, recompiled it with 3.4.4 and does not present this error. Can someone help me? What things have changed from 3.0.46 to 3.4.4 to present this error? Thanks for your help.
error.jpg
error.jpg (330.37 KiB) Viewed 1318 times

User avatar
serge_girard
Posts: 2636
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 911 times
Been thanked: 166 times
Contact:

Post by serge_girard »

What error? It is unreadable!

Serge

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post by AUGE_OHR »

hi,
serge_girard wrote:
Sat Sep 05, 2020 8:02 am
What error? It is unreadable!
under FF i can use right-menu and use "show Image"
i can upsize and get this
MixMode_Error.JPG
MixMode_Error.JPG (46.68 KiB) Viewed 1282 times
have fun
Jimmy

arturoorta
Posts: 14
Joined: Fri Jan 25, 2013 8:19 pm
Has thanked: 1 time

Post by arturoorta »

Anyone can reply this?

User avatar
AUGE_OHR
Posts: 1149
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 213 times
Been thanked: 310 times

Post by AUGE_OHR »

hi,

real Solution : re-write you Code to Full GUI

Workaround : Minimize CRT and Maximie GUI Window to avoid "touch" other Window.
be sure that "no Output" is in CRT Window
have fun
Jimmy

User avatar
dragancesu
Posts: 814
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 30 times
Been thanked: 233 times

Post by dragancesu »

Newer versions have better data control
You should look at the TERMINA_IMP function on line 525 and follow all the variables that appear,
let it be either empty or not the same type if it is a comparison

ASESORMIX
Posts: 129
Joined: Thu Oct 25, 2012 8:08 pm
Location: Bqto, Venezuela
Been thanked: 11 times

Post by ASESORMIX »

Hola.
Si puedes comparte el contenido fuente de la aplicación,
creo que puedo ayudarte.

arturoorta
Posts: 14
Joined: Fri Jan 25, 2013 8:19 pm
Has thanked: 1 time

Post by arturoorta »

Ya revisé varias veces mi código. No tengo errores de definción. Esto funcionaba con 3.0.46

Este es el proceso.

Una función( prepara_imp() ) seleccciona como será enviado el reporte:

Code: Select all

            If lPreview
               Select Printer Default ;
                      Orientation PRINTER_ORIENT_PORTRAIT ;
                      PaperSize   PRINTER_PAPER_LETTER ;
                      Quality     PRINTER_RES_MEDIUM ;
                      Preview
            Else
               Select Printer Default ;
                      Orientation PRINTER_ORIENT_PORTRAIT ;
                      PaperSize   PRINTER_PAPER_LETTER ;
                      Quality     PRINTER_RES_MEDIUM
                     Select Printer Dialog To lEligio

            Endif
En la función de inicia_imp inicializo el reporte:

Code: Select all

FUNCTION inicia_imp()

   If lSisPrnWindows //Impresion en sistema Windows

      If cTipoDoc=="W" //Seleccionar impresora si es reporte en Windows

         Start PrintPage

      ElseIf cTipoDoc=="P" //Seleccionar impresion en PDF

         Start HPDFPage

      ElseIf cTipoDoc=="A" //Seleccionar reporte de texto

         act_arch(cNomArch)

      Endif
Termina_imp() solo manda a llamar al visor de reportes:

Code: Select all

PROCEDURE termina_imp

   If lSisPrnWindows

      ImprimeBuffer()
      If fallo!=BIEN
         Return
      Endif

      If cTipoDoc=="W" //Seleccionar impresora si es reporte en Windows

         End PrintPage
         End PrintDoc

      ElseIf cTipoDoc=="P" //Seleccionar impresion en PDF

         End HPDFPage
         End HPDFDoc

         If lTodoaPDF //opcion especial para crear todos los reportes por pantalla en PDF y visualizarlos
            Execute File cNomArch
         Endif

      ElseIf cTipoDoc=="A" //Seleccionar reporte de texto

         des_arch()
         If !Empty(cNomArch).AND.!lSisPrnWindAnt
            If At(".TXT",cNomArch)=0
               edita_text(2,0,MaxRow(),MaxCol(),cNomArch,nAncho+2)
               Erase(cNomArch)
            Endif
         Endif

      Endif

Pueden ver que no es nada inusual o extraño. El error se origina en el visor de vista previa de los reportes de HMG.

ASESORMIX
Posts: 129
Joined: Thu Oct 25, 2012 8:08 pm
Location: Bqto, Venezuela
Been thanked: 11 times

Post by ASESORMIX »

Observa este ejemplo, espero que te ayude.
Se puede usar el teclado y el raton para manejar el menu.
No requiere compilar con gtwvg.
Yo hice varias aplicaciones mixed usando gtwvg y generaba errores inesperados
hasta que logre programar esta aplicación que te estoy enviando y me ha dado buenos resultados.
Attachments
Menu_En_Dos.zip
(2.47 MiB) Downloaded 47 times

ASESORMIX
Posts: 129
Joined: Thu Oct 25, 2012 8:08 pm
Location: Bqto, Venezuela
Been thanked: 11 times

Post by ASESORMIX »

Ademas se puede ampliar la cantidad de columnas y aumentar la cantidad de filas ( en el formato console texto ).
También se le puede cambiar el icono y cambiar la descripción a la ventana.

Post Reply