FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FiveWin/3 Cannot create Dialog Box on slow network.
Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Tue Feb 05, 2013 03:01 PM

Hello,
our application reports "FiveWin/3 Cannot create Dialog Box" error on some sites when creating common dialogs (no Borland resources involved).

After some investigation I found an idea that problem can be caused by slow network speed when loading resources linked into exe.
Can we somehow force OS to load all (or some specific?) resources in executable on startup so netwok failures will not initiate errors on dialog load?

Taavi.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Tue Feb 05, 2013 05:26 PM

Taavi,

In each DIALOG declaration in the RC file please add the clause PRELOAD

In example:
test DIALOG PRELOAD 22, 74, 174, 97

Lets see if that makes a difference, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Tue Feb 05, 2013 07:27 PM

Taavi

Where are your resources loaded via a .dll? You mentioned 'linked' into the executable ? If that is the case .. I have never had a problem with my resources not being resolved when they are part of ( burned into ) the monolithic executable... if you are trying to resolve your forms via a .dll .. Yes, I could see a slow network causing your resources not to load as fast as they need to.

Rick Lipkin

Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Tue Feb 05, 2013 07:52 PM

Hello,

With latest versions > FW 11.11 I have reported this error some times by some customers.

Unfortunately, I was not able to trace it.

Some customers have reported it too, but it happens from time to time.

Maybe something is not releasing properlly in FWH internals, I don´t know.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Tue Feb 05, 2013 09:16 PM

Lucas,

FWH/source/winapi/dlogbox.c manages all Windows API functions to create dialog boxes.

So there is nothing internal about them :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Wed Feb 06, 2013 10:49 AM

Thank you Antonio for the reply.

This behaviour is very difficult to trace.

In fact, with other software sometimes I have detected ramdom wrong paiting of dialogs. In that case they do not produce Fivewin/3 error, but the program either crashes or shows wrongly.

Maybe is a Windows issue?. Some interference with other software?.

Also, maybe in dialog.prg you could modify to repeat the operation an extra attempt before calling to CreateDlgError() function?. And add a sysrefresh() before the retry?.

Thanks!!

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Wed Feb 06, 2013 03:58 PM

Lucas,

We don't have a slow network here to test with it, so I would appreciate if those that are experiencing this problem on a slow network, could confirm if the suggested enhancements from Lucas make a difference, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Wed Feb 06, 2013 07:23 PM

Antonio,

I was refering in general to this procedure. I was reported the error in local mode (in my systems, when an error.log is generated, it is sent to me so I can monitor errors).

Also, other users reported too, but it happens from time to time.

So that´s why I suggested the idea to introduce a sysrefresh() and an extra retry of the operation before calling the error.

Thanks.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Thu Feb 07, 2013 07:46 AM
Hi Antonio,
can PRELOAD have effect on resources behaviour in 32-bit EXE?

MSDN says it's for 16-bit exes only.

http://msdn.microsoft.com/en-us/library ... 85%29.aspx

I also have "DISCARDABLE" clause in most of declarations from 16-bit history, can it have influence when linking with XHARBOUR?

Taavi


Antonio Linares wrote:Taavi,

In each DIALOG declaration in the RC file please add the clause PRELOAD

In example:
test DIALOG PRELOAD 22, 74, 174, 97

Lets see if that makes a difference, thanks :-)
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Thu Feb 07, 2013 10:26 AM
Antonio Linares wrote:Taavi,

In each DIALOG declaration in the RC file please add the clause PRELOAD

In example:
test DIALOG PRELOAD 22, 74, 174, 97

Lets see if that makes a difference, thanks :-)


Lo acabo de incluir en todas los dialogs de mi sistema. De momento no me ha perjudicado en nada.
Si vuelve a aparecer "FiveWin/3 Cannot create Dialog Box" lo comento
Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Thu Feb 07, 2013 10:43 AM

Taavi,

I would remove DISCARDABLE and use PRELOAD.

Theoretically is just for Windows 16 but the RC compiler does not complain about it, so lets try it.

Lucas proposal seems interesting also. A second try to create the dialog.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Thu Feb 07, 2013 11:15 AM
Ahora define los diálogos así:
Code (fw): Select all Collapse
DIALOGEX PRELOAD 22, 74, 174, 97


Ademas he modificado la clase dialog para realizar 2 intentos en la clase

Code (fw): Select all Collapse
     for i := 1 to 2  //fgondi
       ::nResult = if( ! Empty( ::cResName ),;
                      DialogBox( ::hResources, ::cResName,;
                                 hActiveWnd, Self ),;
                      DialogBoxIndirect( GetInstance(),;
                                         If( ! Empty( ::cResData ), ::cResData, ::cToChar( hActiveWnd ) ),;
                                         hActiveWnd, Self ) )

       if ::nResult<> 65535  //fgondi
         exit
       endif
     next
     if ::nResult == 65535
       CreateDlgError( Self )
    endif


Code (fw): Select all Collapse
         for i := 1 to 2  //fgondi
           if ! Empty( ::cResName ) 
              ::hWnd = CreateDlg( ::hResources, ::cResName, hActiveWnd )
           else   
              ::hWnd = CreateDlgIndirect( GetInstance(), ::cToChar( hActiveWnd ),;
                                          hActiveWnd )
           endif
           if ::hWnd <> 0  //fgondi
             exit
           endif
         next
         if ::hWnd == 0
            CreateDlgError( Self )
         else
            ShowWindow( ::hWnd, SW_HIDE )   
         endif
Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Thu Feb 07, 2013 12:35 PM

Fernando,

Gracias! :-)

Lo has probado ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Thu Feb 07, 2013 04:33 PM

Antonio,

Lo estoy probando. De momento funcionando todo de forma correcta. sin el error "Cannot create dialog Box".
Aunque como es esporádico hay que esperar.
Por cierto, este error ha aparecido incluso en redes rápidas.

También lo estoy probando para un problema que tengo con algunos Windows 7.
En ellos algunas veces al dibujar las ventanas mdi con diálogos incrustados, y de forma esporádica, se quedan bloqueadas durante unos cuantos segundos y luego continua como si nada.
Pero que bloquea incluso todo el sistema operativo, si intentas cambiar a otra aplicación, esta no se ve, aparece toda ella de color negro.
Pasados esos segundo todo vuelve a la normalidad y quizás no vuelve a pasar durante el día o si.

No es un tema de recursos porque ha pasado a primera hora del día y durante todo el día no ha vuelto a pasar, sin que hayan salido de la aplicación.

Estoy investigando en los efectos visuales de windows, por si viene de hay.

Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: FiveWin/3 Cannot create Dialog Box on slow network.
Posted: Fri Feb 08, 2013 10:47 AM

De momento, no ha vuelto a aparecer el error, y todo esta funcionando normalmente.

Si en todo el día de hoy no aparece en ninguno de los 2 clientes en los que lo he incluido (que son los 2 en los que mas a menudo aparecía el error), el lunes lo incluyo en todos los clientes.

Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos