Menu

#69 My procedure HwgInit not run on Linux

v1.0_(example)
open
nobody
None
1
2023-12-15
2023-12-14
No

Hi!
My initial program I put this code.

 INIT PROCEDURE HWGINIT
    #ifdef __PLATFORM__WINDOWS   
       MyErrSys()
    #else
       hwg_gtk_init()
       hwg_InitProc()
       MyErrSys()
       Set( _SET_INSERT, .F. )
    #endif
 RETURN

But Hwgui(gtk) not get it.
And other situatin is than while error occur the screen (dialog) of error it freezing, not end.

Best regards,
Itamar M. Lins Jr.

Discussion

  • Alexander S.Kresin

    Init procedures in all prgs are executed.
    Your hwginit procedure doesn't override the existing in hwgui, it is executed additionally. So, you do not need to launch hwg_gtk_init(), hwg_InitProc() from there.
    As far as I understand, you need to override the hwg_ErrSys(). It is better to do this in the beginning of your Func Main(), because it isn't garantied that your init procedure will be executed after that one from hwgui.

    Regards, Alexander.

     
    • Itamar M. Lins Jr.

      Hi!

      Using it on Windows, I've been using it like this for many years.
      Without needing to touch the Hwgui code. I can replace the standard hwgui error with one I made and added a code to receive the error by email.
      I copied the herrsys.prg routine from the \source\winapi\herrsys.prg folder to my folder and modified it.
      It works on Windows.

      Fragment of code herrsys.prg into my folder.

      PROCEDURE MyErrSys()
      
         ErrorBlock( { | oError | DefError( oError ) } )
         LogInitialPath := hb_ps() + CurDir() + IIf( Empty( CurDir() ), "", hb_ps() )
      
         //LogInitialPath := hb_Curdrive()+":\"+rtrim(curdir())+ "\"
      
         RETURN
      
      STATIC FUNCTION DefError( oError )
      
         LOCAL cMessage
         LOCAL cDOSError
         LOCAL cLogFile := DTOS(DATE())+StrTran( TIME(), ":", "_")+".html"
         LOCAL n
      

      Best regards.
      Itamar M. Lins Jr.

       
  • Alexander S.Kresin

    Just try to remove hwg_gtk_init() and hwg_InitProc() from your init procedure

     
    • Itamar M. Lins Jr.

      Hi!
      I had already done that.
      I've tried several ways.
      Even the standard herrsys on Linux does not close the system when it encounters an error, as stated.
      I attach the screen demonstrating the problem.

      Best regards,
      Itamar M. Lins Jr.

       
  • Alexander S.Kresin

    Even the standard herrsys on Linux does not close the system when it encounters an error, as stated.

    Yes, sometimes this happens, this depends on the place where error occurs. I never had patience enough to investigate this.

    Hwgui(gtk) not get it

    Insert hwg_writelog() there to test and you will see that this code is executed.

    Regards, Alexander.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.