Page 1 of 2

FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Tue Feb 05, 2013 3:01 pm
by Taavi
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.

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Tue Feb 05, 2013 5:26 pm
by Antonio Linares
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 :-)

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Tue Feb 05, 2013 7:27 pm
by Rick Lipkin
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

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Tue Feb 05, 2013 7:52 pm
by lucasdebeltran
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.

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Tue Feb 05, 2013 9:16 pm
by Antonio Linares
Lucas,

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

So there is nothing internal about them :-)

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Wed Feb 06, 2013 10:49 am
by lucasdebeltran
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!!

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Wed Feb 06, 2013 3:58 pm
by Antonio Linares
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 :-)

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Wed Feb 06, 2013 7:23 pm
by lucasdebeltran
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.

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Thu Feb 07, 2013 7:46 am
by Taavi
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 :-)

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Thu Feb 07, 2013 10:26 am
by fgondi
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

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Thu Feb 07, 2013 10:43 am
by Antonio Linares
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.

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Thu Feb 07, 2013 11:15 am
by fgondi
Ahora define los diálogos así:
Code: Select all  Expand view
DIALOGEX PRELOAD 22, 74, 174, 97


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

Code: Select all  Expand view
    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: Select all  Expand view
        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
 

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Thu Feb 07, 2013 12:35 pm
by Antonio Linares
Fernando,

Gracias! :-)

Lo has probado ?

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Thu Feb 07, 2013 4:33 pm
by fgondi
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.

Re: FiveWin/3 Cannot create Dialog Box on slow network.

PostPosted: Fri Feb 08, 2013 10:47 am
by fgondi
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.