Page 1 of 2

Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Fri Mar 22, 2019 6:14 pm
by Horizon
Hi,

This error comes randomly. I dont use RESOURCE.

How Can I solve this?

Code: Select all  Expand view
Application
===========
   Path and name: C:\OBJEKT\IcraW\icraw.exe (32 bits)
   Size: 3,494,400 bytes
   Compiler version: Harbour 3.2.0dev (r1801051438)
   FiveWin  version: FWH 18.11
   C compiler version: Microsoft Visual C++ 19.12.25835 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 3 hours 52 mins 29 secs
   Error occurred at: 20/03/2019, 13:11:02
   Error description: Error FiveWin/3  Cannot create Dialog Box:
                      Title: Dialog 5

Stack Calls
===========
   Called from: .\source\classes\DIALOG.PRG => CREATEDLGERROR( 717 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 321 )
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:DEFAULT( 849 )
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:INITIATE( 1047 )
   Called from:  => __OBJSENDMSG( 0 )
   Called from: .\source\function\HARBOUR.PRG => OSEND( 291 )
   Called from: .\source\function\HARBOUR.PRG => ASEND( 259 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 805 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 330 )
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:DEFAULT( 849 )
   Called from: .\source\classes\TFOLDEX.PRG => TFOLDEREX:INITIATE( 1047 )
   Called from:  => __OBJSENDMSG( 0 )
   Called from: .\source\function\HARBOUR.PRG => OSEND( 291 )
   Called from: .\source\function\HARBOUR.PRG => ASEND( 259 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 805 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 1120 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
   Called from: .\TOb_Browse1.prg => TYK_DETAY:ACTIVATE( 1708 )

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Fri Mar 22, 2019 6:56 pm
by ukoenig
Hakan,

it seems the error belongs to TFolderEx

can You show a detail how the folder is called from inside the dialog :?:

regards
Uwe :?:

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Fri Mar 22, 2019 7:19 pm
by Horizon
Hi Uwe,

ukoenig wrote:Hakan,

it seems the error belongs to TFolderEx

can You show a detail how the folder is called from inside the dialog :?:

regards
Uwe :?:


Code: Select all  Expand view
 @ 2, 3 FOLDERex oFld OF oDlg PIXEL ;
      PROMPTS "&Genel", "Takibin K&onusu";
      ROUND 10 ON CHANGE FOLDER_CHANGE(nOption, nOldOption, Self, oSelf)

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Fri Mar 22, 2019 8:05 pm
by karinha
Code: Select all  Expand view

#include "FiveWin.ch"

FUNCTION Main()

   local oDlg, oFld, oGet, cTest := "Hello world", cAnother := "Another GET"
   local oFont, oFnt

   DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -14 BOLD
   DEFINE FONT oFnt  NAME "Ms Sans Serif" SIZE 00, -12 BOLD

   DEFINE DIALOG oDlg SIZE 400, 300

   oDlg:lHelpIcon := .F.

   @ 3, 5 FOLDEREX oFld PIXEL                          ;
          PROMPTS "&Genel", "Takibin K&onusu", "Other" ;
          TAB HEIGHT 25 ROUND 5                        ;
          FONT oFnt COLOR CLR_HCYAN TOP SIZE 190, 120

   oFld:SetOption( 1 )
   oFld:aEnable = { .T., .T., .F. }
   oFld:Show()
     
   @ 1, 1 GET oGet VAR cTest OF oFld:aDialogs[ 1 ] SIZE 50,12
   
   @ 2, 1 GET cAnother OF oFld:aDialogs[ 1 ] SIZE 50, 12
   
   @ 7.2, 14 BUTTON "&Exit" ACTION( oDlg:End() ) CANCEL
         
   ACTIVATE DIALOG oDlg CENTERED ;
            ON INIT ( oGet:SetFocus(), .F. )

   oFnt:End()
   oFont:End()

RETURN( NIL )
 



Regards.

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sat Mar 23, 2019 8:28 am
by Horizon
Hi,

My code is works normally. But sometimes gives an error.

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sat Mar 23, 2019 8:44 am
by Antonio Linares
Please modify dialog.prg this way:

Code: Select all  Expand view
     if ::nResult == 65535
         MsgInfo( GetLastError() )
         CreateDlgError( Self )
      endif


Lets check the generated specific error

We are going to enhance FWH to automatically show GetLastError() on those circunstances

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sat Mar 23, 2019 9:31 am
by Antonio Linares
This solution seems a better one to know what is the system error:

Already included in next FWH 19.02

Inside dialog.prg
Code: Select all  Expand view
static function CreateDlgError( Self, nGetLastError )

   local cRes := If( ValType( ::cResName ) == "N", Str( ::cResName ), ::cResName )
   local cPad := Replicate( Chr( 32 ), 22 )

   #define CANNOTCREATE_DIALOG 3
   Eval( ErrorBlock(), ;
        _FwGenError( CANNOTCREATE_DIALOG, CRLF + cPad + ;
                     If( ! Empty( cRes ), "Resource: " + cRes,;
                     "Title: " + If( Empty( ::cCaption ), "", ::cCaption ) + ", System Error: " + GetErrMsg( nGetlastError ) ) ) )
return nil
 

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sat Mar 23, 2019 9:57 am
by Antonio Linares
function GetErrMsg() in source\winapi\creatwnd.c has to be modified also this way:

These enhancements are already included in next FWH 19.02

Code: Select all  Expand view
HB_FUNC( GETERRMSG ) // --> cSystemError
{
   LPVOID lpMsgBuf;
   DWORD dwLastError = GetLastError();

   if( hb_pcount() > 0 )
      dwLastError = hb_parnl( 1 );

   FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                  NULL,
                  dwLastError,
                  MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), // Default language
                  ( LPTSTR ) &lpMsgBuf,
                  0,
                  NULL );

   hb_retc( ( char * ) lpMsgBuf );
   LocalFree( lpMsgBuf );
}

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sat Mar 23, 2019 6:54 pm
by Horizon
Thank you Antonio,

I will try but, can you please mail me revised libs if it is possible?

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sat Mar 23, 2019 9:05 pm
by Antonio Linares
Hakan,

What C compiler version ?

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sun Mar 24, 2019 8:39 am
by Horizon
Antonio Linares wrote:Hakan,

What C compiler version ?


Code: Select all  Expand view
Compiler version: Harbour 3.2.0dev (r1801051438)
   FiveWin  version: FWH 18.12
   C compiler version: Microsoft Visual C++ 19.12.25835 (32-bit)
   Windows version: 6.2, Build 9200

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sun Mar 24, 2019 1:33 pm
by Antonio Linares
Already sent

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sun Mar 24, 2019 4:45 pm
by Horizon
Antonio Linares wrote:Already sent


Thank you Antonio,

Can you please accept my access request?

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sun Mar 24, 2019 6:04 pm
by Antonio Linares
done

Re: Error FiveWin/3 Cannot create Dialog Box:

PostPosted: Sun Mar 24, 2019 6:51 pm
by Horizon
Hi Antonio,

I do full compile, it gives a runtime error when I run my application.

Should I wait for full fwh update?

Code: Select all  Expand view
  Time from start: 0 hours 0 mins 1 secs
   Error occurred at: 24/03/2019, 21:23:20
   Error description: Error BASE/1005  Message not found: TMENUITEM:_BBLOCK
   Args:
     [   1] = O   TMENUITEM

Stack Calls
===========
   Called from:  => __ERRRT_SBASE( 0 )
   Called from: ../../../tobject.prg => TMENUITEM:ERROR( 0 )
   Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
   Called from: ../../../tobject.prg => TMENUITEM:MSGNOTFOUND( 0 )
   Called from: ../../../tobject.prg => TMENUITEM:_BBLOCK( 0 )
   Called from: .\source\classes\PDMENU.PRG => MENUEND( 414 )
   Called from: .\Master.prg => DEFINE_RIBBON( 1554 )
   Called from: .\Master.prg => (b)MAIN( 280 )
   Called from: .\TApplication.prg => TAPPLICATION:ACTIVATE( 999 )
   Called from: .\Master.prg => MAIN( 319 )