Unresolved Code

Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Unresolved Code

Post by Arindam »

Hi Everybody,

I am getting the following error while compiling. I will be greatful if anyone can identify me where is my problem.

Code: Select all

Static Function BackRest()   
   Local oLbx, nItem := 0, oMeter, nMeter
   Local n, nSelected := 0, aSel := {}

   //Set Default
   SET DELETED OFF

   // Replace variable.
   lpath   := (CurDrive() + ":\" + "Blazepro\Data\")   // Static Vari
   tpath   := Space(25)                                            // Static Vari
   lType   := Space(1)                                             // Static Vari
   lpath   := AllTrim(lpath)                                       // Static Vari

   DEFINE DIALOG oDlg RESOURCE "BACKREST" of oBacktWnd TITLE "BACKUP / RESTORE FUNCTION" Color "W/W"

   REDEFINE SAY oSay ID  1 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  2 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  3 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  4 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  5 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  6 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  7 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  8 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  9 OF oDlg Color "N/W" Font oFont 

   REDEFINE GET oGet Var lType ID 10 OF oDlg                     ;
      Valid     reqdata(ltype) .And. (ltype ="D" .Or. ltype ="M") ;     
      Picture "@!" Color "B+/W"

   REDEFINE GET oGet Var tPath ID 11 OF oDlg ;
      Valid  reqdata(tPath)                  ;     
      Picture "@!" Color "B+/W"

   REDEFINE LISTBOX oLbx VAR nItem ;
      ID 0 OF oDlg ;
      ITEMS aDataFiles() ;
      BITMAPS { "CHECKON", "CHECKOFF" } ;
      ON DRAWITEM ( IIF(aScan(oLbx:GetSelItems(),nItem) >0, 1, 2) );
      ON CHANGE (nSelected := oLbx:GetSelCount(), oDlg:AevalWhen());
      COLOR "N/W"

   REDEFINE button ID 13 OF oDLG ;
      ACTION (aeval(oLbx:aItems,{|o,n| oLbx:SetSel(n,.t.) }), oLbx:Change())

   REDEFINE button ID 14 OF oDLG ;
      ACTION (aeval(oLbx:aItems,{|o,n| oLbx:SetSel(n,.f.) }), oLbx:Change());
      WHEN nSelected > 0

   REDEFINE button ID 15 OF oDLG ;
      ACTION BackUp(oLbx, lpath, tpath, lType), oLbx:Change();
      WHEN nSelected > 0

   REDEFINE button ID 16 OF oDLG //;
      //ACTION Restore(oLbx,lpath, tpath), oLbx:Change();
      //WHEN nSelected > 0

   REDEFINE button ID 12 of oDLG CANCEL;
      ACTION oDlg:END()

   ACTIVATE DIALOG oDlg ;
     VALID oBacktWnd:End()                       // ***** Geting error *****

   oDlg:aControls[ 10 ]:Setfocus(.T.)

Return Nil
Note : I am getting error -> Error description: Error BASE/1004
Class: 'NIL' has no exported method:
GETMENUITEM
Args:
[ 1] = N 2090312480

I fail to understand from where this "GETMENUITEM" comming and how I can solve it.

With Regards
ARINDAm
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

Hi Arindam,

what is the value of oBacktWnd in your valid clause of oDlg?

Regards,
Detlef
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Arindam,

Is oBacktWnd:End() returning a logical value ? It should
regards, saludos

Antonio Linares
www.fivetechsoft.com
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Thanks for reply.

I am not getting compiling error. The said error is runtime error. Sorry for mis-communication in myearly post. I am sending more detail to identify the poblem.

Code: Select all

// Include files details
#include "FiveWin.ch"

Static oBacktWnd, lPath, TPath, lType, lDrive, oDLG, oFont

//----------------------------------------------------------------------------//

Function BackupFun( oSubMenu59, oMenu, UserName, UserType, Fun_Acces, today, oWnd )       // Call from main
   // Set as required
   Set Century On
   Set Date Brit
   Set Date format "dd/mm/yyyy"
   
   // Disable menuitem and refresh menu
   oSubMenu59:Disable()
   oMenu:Refresh()
   
   DEFINE FONT oFont NAME "COURIER" SIZE 6, 9
   
   DEFINE ICON oIco File (CurDrive() + ":\" + "Blazepro\Image\Favorite.ico")

   DEFINE WINDOW oBacktWnd MDICHILD From 4, 0.5 To 45, 100.5 ;
    TITLE "BackRest"  ICON oIco of oWnd ;
    NO MAXIMIZE

   SET FONT of oBacktWnd to oFont
   
   ACTIVATE WINDOW oBacktWnd  ;
     On INIT BackRest()       ;
     VALID CloseFunc( oSubMenu59, oMenu, oDlg )

   RELEASE FONT oFont
Return Nil

//----------------------------------------------------------------------------//

Static Function BackRest()   
   Local oLbx, nItem := 0, oMeter, nMeter
   Local n, nSelected := 0, aSel := {}

   //Set Default
   SET DELETED OFF

   // Replace variable.
   lpath   := (CurDrive() + ":\" + "Blazepro\Data\") 
   tpath   := Space(25)
   lType   := Space(1)
   lpath   := AllTrim(lpath)

   DEFINE DIALOG oDlg RESOURCE "BACKREST" of oBacktWnd TITLE "BACKUP / RESTORE FUNCTION" Color "W/W"

   REDEFINE SAY oSay ID  1 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  2 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  3 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  4 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  5 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  6 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  7 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  8 OF oDlg Color "N/W" Font oFont 
   REDEFINE SAY oSay ID  9 OF oDlg Color "N/W" Font oFont 

   REDEFINE GET oGet Var lType ID 10 OF oDlg                     ;
      Valid     reqdata(ltype) .And. (ltype = "D" .Or. ltype ="M") ;     
      Picture "@!" Color "B+/W"

   REDEFINE GET oGet Var tPath ID 11 OF oDlg ;
      Valid  reqdata(tPath)                  ;     
      Picture "@!" Color "B+/W"

   REDEFINE LISTBOX oLbx VAR nItem ;
      ID 0 OF oDlg ;
      ITEMS aDataFiles() ;
      BITMAPS { "CHECKON", "CHECKOFF" } ;
      ON DRAWITEM ( IIF(aScan(oLbx:GetSelItems(),nItem) >0, 1, 2) );
      ON CHANGE (nSelected := oLbx:GetSelCount(), oDlg:AevalWhen());
      COLOR "N/W"

   REDEFINE button ID 13 OF oDLG ;
      ACTION (aeval(oLbx:aItems,{|o,n| oLbx:SetSel(n,.t.) }), oLbx:Change())

   REDEFINE button ID 14 OF oDLG ;
      ACTION (aeval(oLbx:aItems,{|o,n| oLbx:SetSel(n,.f.) }), oLbx:Change());
      WHEN nSelected > 0

   REDEFINE button ID 15 OF oDLG ;
      ACTION BackUp(oLbx, lpath, tpath, lType), oLbx:Change();
      WHEN nSelected > 0

   REDEFINE button ID 16 OF oDLG //;
      //ACTION Restore(oLbx,lpath, tpath), oLbx:Change();
      //WHEN nSelected > 0

   REDEFINE button ID 12 of oDLG CANCEL;
      ACTION oDlg:END()

   ACTIVATE DIALOG oDlg ;
     VALID oBacktWnd:End()

   oDlg:aControls[ 10 ]:Setfocus(.T.)

Return Nil

//----------------------------------------------------------------------------//

Static Function CloseFunc( oMenuItm, oMenu, oDlg )
   If ValType(oDlg) = "O"
      oDlg:End()
   Endif
   
   oMenuItm:Enable()
   oMenu:Refresh(.T.)      
   
Return .T.

//----------------------------------------------------------------------------//

STATIC FUNCTION aDataFiles()
RETURN {                                                ;
        (CurDrive() + ":\BlazePro\Data\Complain.Dbf") , ;
        (CurDrive() + ":\BlazePro\Data\Mechanic.Dbf") , ;
        (CurDrive() + ":\BlazePro\Data\Customer.Dbf") , ;
        (CurDrive() + ":\BlazePro\Data\Custarea.Dbf") , ;
        (CurDrive() + ":\BlazePro\Data\Balance.Dbf")  , ;
        (CurDrive() + ":\BlazePro\Data\Payment.Dbf")  , ;
        (CurDrive() + ":\BlazePro\Data\Defpr.Dbf")    , ;
        (CurDrive() + ":\BlazePro\Data\Bank.Dbf")     , ;
        (CurDrive() + ":\BlazePro\Data\Change.Dbf")     ;
   }

Note : Even if I mark "Valid oBacktWnd:End()", same error reporting.

With Regards
Arindam
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

Arindam,

please replace your code
ACTIVATE DIALOG oDlg ;
VALID oBacktWnd:End()
with this

Code: Select all

ACTIVATE DIALOG oDlg ; 
     VALID( oBacktWnd:End(), .t. )
As Antonio says, a valid clause needs a logical expression.

Hope this helps,
Detlef
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Thanks Detlef for your reply.

I have modify the code as Antonio says prior to send my last post. After doing this I got same error during run the prog. I fail to understand where is my mistake. I am attaching hereiwth the error list details, so that if you can identify the mistake.
  • Application
    ===========
    Path and name: D:\Project_Fwh\blaze.exe (32 bits)
    Size: 2,912,256 bytes
    Time from start: 0 hours 0 mins 16 secs
    Error occurred at: 26/01/2007, 00:58:35
    Error description: Error BASE/1004 Class: 'NIL' has no exported method: GETMENUITEM
    Args:
    [ 1] = N 2090312480

    Stack Calls
    ===========
    Called from: => GETMENUITEM(0)
    Called from: WINDOW.PRG => TDIALOG:MEASUREITEM(0)
    Called from: WINDOW.PRG => TWINDOW:HANDLEEVENT(0)
    Called from: DIALOG.PRG => TDIALOG:HANDLEEVENT(0)
    Called from: => DIALOGBOX(0)
    Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
    Called from: => BACKREST(109)
    Called from: FileBackup.prg => (b)BACKUPFUN(39)
    Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
    Called from: MDICHILD.PRG => TMDICHILD:ACTIVATE(0)
    Called from: FileBackup.prg => BACKUPFUN(39)
    Called from: => CALLFUN(1019)
    Called from: Blaze.prg => (b)BUILDMENU(817)
    Called from: MENU.PRG => TMENU:COMMAND(0)
    Called from: WINDOW.PRG => TWINDOW:COMMAND(0)
    Called from: MDIFRAME.PRG => TMDIFRAME:COMMAND(0)
    Called from: WINDOW.PRG => TMDIFRAME:HANDLEEVENT(0)
    Called from: WINDOW.PRG => _FWH(0)
    Called from: => WINRUN(0)
    Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
    Called from: Blaze.prg => MAIN(154)

    Variables in use
    ================
    Procedure Type Value
    ==========================
    GETMENUITEM
    Param 1: N 2090312480
    Local 1: U
    Local 2: U
    Local 3: N 0
    TDIALOG:MEASUREITEM
    Param 1: N 0
    Param 2: N 1238736
    Local 1: O Class: TDIALOG
    Local 2: U
    Local 3: U
    TWINDOW:HANDLEEVENT
    Param 1: N 44
    Param 2: N 0
    Param 3: N 1238736
    TDIALOG:HANDLEEVENT
    Param 1: N 44
    Param 2: N 0
    Param 3: N 1238736
    Local 1: O Class: TDIALOG
    DIALOGBOX
    Param 1: N 4194304
    Param 2: C "BACKREST"
    Param 3: N 394452
    Param 4: O Class: TDIALOG
    TDIALOG:ACTIVATE
    Param 1: U
    Param 2: U
    Param 3: U
    Param 4: L .F.
    Param 5: B {|| ... }
    Param 6: L .T.
    Param 7: U
    Param 8: U
    Param 9: U
    Param 10: L .F.
    Local 1: O Class: TDIALOG
    Local 2: N 394452
    Local 3: U
    Local 4: U
    Local 5: U
    Local 6: O Class: TDIALOG
    BACKREST
    Local 1: O Class: TLISTBOX
    Local 2: N 0
    Local 3: U
    Local 4: U
    Local 5: U
    Local 6: N 0
    Local 7: A Len: 0
    (b)BACKUPFUN
    Param 1: O Class: TMDICHILD
    TWINDOW:ACTIVATE
    Param 1: C "NORMAL"
    Param 2: U
    Param 3: U
    Param 4: U
    Param 5: U
    Param 6: U
    Param 7: U
    Param 8: B {|| ... }
    Param 9: U
    Param 10: U
    Param 11: U
    Param 12: U
    Param 13: U
    Param 14: U
    Param 15: U
    Param 16: U
    Param 17: B {|| ... }
    Local 1: U
    Local 2: U
    Local 3: O Class: TMDICHILD
    Local 4: U
    Local 5: U
    TMDICHILD:ACTIVATE
    Param 1: U
    Param 2: U
    Param 3: U
    Param 4: U
    Param 5: U
    Param 6: U
    Param 7: U
    Param 8: B {|| ... }
    Param 9: U
    Param 10: U
    Param 11: U
    Param 12: U
    Param 13: U
    Param 14: U
    Param 15: U
    Param 16: U
    Param 17: B {|| ... }
    Param 18: O Class: TMDICHILD
    Param 19: U
    BACKUPFUN
    Param 1: O Class: TMENUITEM
    Param 2: O Class: TMENU
    Param 3: C "PAPPU "
    Param 4: C "P"
    Param 5: A Len: 9
    Param 6: D 26/01/2007
    Param 7: O Class: TMDIFRAME
    CALLFUN
    Param 1: O Class: TMENUITEM
    Param 2: N 59
    Param 3: C "oSub"
    Local 1: A Len: 7
    Local 2: N 7
    Local 3: N 0
    Local 4: N 0
    Local 5: N 8
    (b)BUILDMENU
    Param 1: O Class: TMENUITEM
    TMENU:COMMAND
    Param 1: N 20278
    Local 1: O Class: TMENU
    Local 2: O Class: TMENUITEM
    TWINDOW:COMMAND
    Param 1: N 20278
    Param 2: N 0
    Local 1: O Class: TMDIFRAME
    Local 2: N 0
    Local 3: N 20278
    Local 4: N 0
    TMDIFRAME:COMMAND
    Param 1: N 20278
    Param 2: N 0
    Local 1: O Class: TMDIFRAME
    Local 2: L .F.
    TMDIFRAME:HANDLEEVENT
    Param 1: N 273
    Param 2: N 20278
    Param 3: N 0
    _FWH
    Param 1: N 0
    Param 2: N 273
    Param 3: N 20278
    Param 4: N 0
    Param 5: N 1
    Local 1: O Class: TMDIFRAME
    WINRUN
    Param 1: N 197826
    TMDIFRAME:ACTIVATE
    Param 1: C "NORMAL"
    Param 2: U
    Param 3: U
    Param 4: U
    Param 5: U
    Param 6: B {|| ... }
    Param 7: U
    Param 8: B {|| ... }
    Param 9: U
    Param 10: U
    Param 11: U
    Param 12: U
    Param 13: U
    Param 14: U
    Param 15: U
    Param 16: U
    Param 17: B {|| ... }
    Param 18: U
    Param 19: U
    Local 1: O Class: TMDIFRAME
    Local 2: U
    Local 3: U
    MAIN
    Local 1: O Class: TBITMAP
    Local 2: O Class: TICON
    Local 3: O Class: TMSGITEM
    Local 4: O Class: TMSGITEM
    Local 5: U
    Local 6: U

    Linked RDDs
    ===========
    DBF
    DBFFPT
    DBFNTX
    DBFBLOB

    DataBases in use
    ================

    1: LOGDBF RddName: DBFNTX
    ==============================
    RecNo RecCount BOF EOF
    1 1 .F. .F.

    Indexes in use TagName

    Relations in use

    Classes in use:
    ===============
    1 HBCLASS
    2 HBOBJECT
    3 TWINDOW
    4 TCONTROL
    5 TBITMAP
    6 TBRUSH
    7 TICON
    8 TFONT
    9 TMDIFRAME
    10 TMENU
    11 TMENUITEM
    12 TMDICLIENT
    13 TMSGBAR
    14 TRECT
    15 TMSGITEM
    16 TTIMER
    17 TDIALOG
    18 TGET
    19 GET
    20 TCLIPGET
    21 TBUTTON
    22 TSAY
    23 TMDICHILD
    24 TLISTBOX
    25 ERROR
    26 TREG32
Waiting for your reply.

With Regards,

Arindam
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

Arindam,

instead of writing:
ACTIVATE DIALOG oDlg VALID oBacktWnd:End()

please, try:
ACTIVATE DIALOG oDlg VALID( oBacktWnd:End(), .t. )

And tell me your result.

Regards,
Detlef
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Once again thanks Detlef.

In my last post I wrote you that I had tried as Antonio says :

" Is oBacktWnd:End() returning a logical value ? It should".

The Result is same.

Finaly I change my code as follows :


// Include files details
#include "FiveWin.ch"
#include "Fileio.ch"
#include "Inkey.ch"
#include "Font.ch"
#include "Color.ch"

Static oBacktWnd, lPath, TPath, lType, lDrive, oDLG, oFont
//----------------------------------------------------------------------------//

Function Main()
// Set as required
SET _3DLOOK ON
Set Century On
Set Date Brit
Set Date format "dd/mm/yyyy"

DEFINE FONT oFont NAME "COURIER" SIZE 6, 9

DEFINE ICON oIco File ("D:\Blazepro\Image\Favorite.ico")

DEFINE WINDOW oBacktWnd From 25, 185.5 To 45, 205.5 ;
TITLE "BackRest" ICON oIco ;
NO MAXIMIZE

SET FONT of oBacktWnd to oFont

ACTIVATE WINDOW oBacktWnd ;
On INIT BackRest() ;
VALID CloseFunc( oDlg )

RELEASE FONT oFont
Return Nil

//----------------------------------------------------------------------------//

Static Function BackRest()
Local oLbx, nItem := 0, oMeter, nMeter
Local n, nSelected := 0, aSel := {}

//Set Default
SET DELETED OFF

// Replace variable.
lpath := (CurDrive() + ":\" + "Blazepro\Data\")
tpath := Space(25)
lType := Space(1)
lpath := AllTrim(lpath)

DEFINE DIALOG oDlg RESOURCE "BACKREST" of oBacktWnd TITLE "BACKUP / RESTORE FUNCTION" Color "W/W"

REDEFINE SAY oSay ID 1 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 2 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 3 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 4 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 5 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 6 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 7 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 8 OF oDlg Color "N/W" Font oFont
REDEFINE SAY oSay ID 9 OF oDlg Color "N/W" Font oFont

REDEFINE GET oGet Var lType ID 10 OF oDlg ;
Valid reqdata(ltype) .And. (ltype ="D" .Or. ltype ="M") ; // Daily or Monthly backup
Picture "@!" Color "B+/W"

REDEFINE GET oGet Var tPath ID 11 OF oDlg ;
Valid reqdata(tPath) ;
Picture "@!" Color "B+/W"

REDEFINE LISTBOX oLbx VAR nItem ;
ID 0 OF oDlg ;
ITEMS aDataFiles() ;
BITMAPS { "CHECKON", "CHECKOFF" } ;
ON DRAWITEM ( IIF(aScan(oLbx:GetSelItems(),nItem) >0, 1, 2) );
ON CHANGE (nSelected := oLbx:GetSelCount(), oDlg:AevalWhen());
COLOR "N/W"

REDEFINE button ID 13 OF oDLG ;
ACTION (aeval(oLbx:aItems,{|o,n| oLbx:SetSel(n,.t.) }), oLbx:Change())

REDEFINE button ID 14 OF oDLG ;
ACTION (aeval(oLbx:aItems,{|o,n| oLbx:SetSel(n,.f.) }), oLbx:Change());
WHEN nSelected > 0

REDEFINE button ID 15 OF oDLG ;
ACTION BackUp(oLbx, lpath, tpath, lType), oLbx:Change();
WHEN nSelected > 0

REDEFINE button ID 16 OF oDLG //;
//ACTION Restore(oLbx,lpath, tpath), oLbx:Change();
//WHEN nSelected > 0

REDEFINE button ID 12 of oDLG CANCEL;
ACTION oDlg:END()

ACTIVATE DIALOG oDlg ;
VALID (oBacktWnd:End(), .T.)

oDlg:aControls[ 10 ]:Setfocus(.T.)

Return Nil

//----------------------------------------------------------------------------//

Static Function BackUp(oLbx, SourcePath, TargetPath, BackupType)
/* My Backup Code
Where :

SourcePath == ("D:\Blazepro\Data\")
TargetPath == ("D:\Blazepro\Backup\")
BackupType == "D"

*/
Return Nil

//----------------------------------------------------------------------------//

STATIC FUNCTION aDataFiles()
RETURN { ;
("D:\BlazePro\Data\Complain.Dbf") , ;
("D:\BlazePro\Data\Mechanic.Dbf") , ;
("D:\BlazePro\Data\Customer.Dbf") , ;
("D:\BlazePro\Data\Custcat.Dbf") , ;
("D:\BlazePro\Data\Custarea.Dbf") , ;
("D:\BlazePro\Data\Proprice.Dbf") , ;
("D:\BlazePro\Data\Payment.Dbf") , ;
("D:\BlazePro\Data\Change.Dbf") ;
}

//----------------------------------------------------------------------------//

Static Function CloseFunc( oDlg )
If ValType(oDlg) = "O"
oDlg:End()
Endif

Return .T.


//----------------------------------------------------------------------------//

Function ReqData( Param )

If Empty( Param )
MsgStop("Currentt field can not be BLANK.",;
"WARNING")
Return .F.
Endif
Return .T.

The error report details :

Application
===========
Path and name: D:\XHB\bin\backupTest.exe (32 bits)
Size: 1,525,248 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 26/01/2007, 12:35:02
Error description: Error BASE/1004 Class: 'NIL' has no exported method: GETMENUITEM
Args:
[ 1] = N 2090312480

Stack Calls
===========
Called from: => GETMENUITEM(0)
Called from: WINDOW.PRG => TDIALOG:MEASUREITEM(0)
Called from: WINDOW.PRG => TWINDOW:HANDLEEVENT(0)
Called from: DIALOG.PRG => TDIALOG:HANDLEEVENT(0)
Called from: => DIALOGBOX(0)
Called from: DIALOG.PRG => TDIALOG:ACTIVATE(0)
Called from: => BACKREST(97)
Called from: MainBackup.prg => (b)MAIN(30)
Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
Called from: MainBackup.prg => MAIN(30)

System
======
CPU type: Intel(R) Pentium(R) 4 CPU 2.26GHz 2283 Mhz
Hardware memory: 376 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 0.99.61 Intl. (SimpLex)

With Regards

Arindam
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

Arindam,
ACTIVATE DIALOG oDlg ;
VALID (oBacktWnd:End(), .T.)

oDlg:aControls[ 10 ]:Setfocus(.T.)
Shouldn't the be an ON INIT before

Code: Select all

VALID (oBacktWnd:End(), .T.);
ON INIT;
oDlg:aControls[ 10 ]:Setfocus(.T.)
?

Regards,
Detlef
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Arindam,

Please post the RC portion for "BACKREST" dialog, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Arindam,

You may need to modify Class TWindow Method MeasureItem() (fwh\source\classes\window.prg):

Code: Select all

METHOD MeasureItem( nIdCtl, pMitStruct ) CLASS TWindow

   local nAt, oItem

   // Warning: On this message the Controls still are not initialized
   // because WM_MEASUREITEM is sent before of WM_INITDIALOG

   if nIdCtl == 0 // Menu
      if ::oPopup != nil
         oItem = ::oPopup:GetMenuItem( GetMeaItem( pMitStruct ) )
      endif
      if oItem == nil .and. ::oSysMenu != nil
         oItem = ::oSysMenu:GetMenuItem( GetMeaItem( pMitStruct ) )
      endif
      if oItem == nil .and. ::oMenu != nil  // NEW !!!!!!!!
         ::oPopup = nil
         oItem = ::oMenu:GetMenuItem( GetMeaItem( pMitStruct ) )
      endif
      if oItem != nil
         MenuMeasureItem( pMitStruct,;
                          GetTextWidth( 0, StrTran( oItem:cPrompt, "&", "" ) ) + ;
                          If( ValType( oItem:bAction ) == "B", 20, 0 ) + 20 )
      endif        //+20 introduced due Error on NT on width calculation 1999/05/19
      return .f.  // default behavior
   endif

   if ( nAt := AScan( ::aControls, { | oCtrl | oCtrl:nId == nIdCtl } ) ) != 0
      return ::aControls[ nAt ]:FillMeasure( pMitStruct )
   endif

return nil
This is the modified line:
if oItem == nil .and. ::oMenu != nil // NEW !!!!!!!!
regards, saludos

Antonio Linares
www.fivetechsoft.com
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Thanks Antonio for your recent support.

As per your advice, I have modified the line in window.prg. But I am getting same error. As you have asked to post the contents of BACKREST.RC, I am pesting harewith.

Code: Select all


BACKREST DIALOG 0, 0, 271, 162
STYLE DS_ABSALIGN |DS_FIXEDSYS |WS_POPUP |WS_VISIBLE |WS_THICKFRAME |WS_CAPTION
CAPTION "BACHUP RESTORE FUNCTION"
FONT 9, "Arial"
{
  CONTROL "",0,"LISTBOX",LBS_OWNERDRAWFIXED |LBS_MULTIPLESEL |LBS_NOTIFY |WS_CHILD |WS_BORDER |WS_VSCROLL |WS_TABSTOP |WS_VISIBLE ,3,62,207,253
  CONTROL "Select ...",1,"BUTTON",BS_GROUPBOX |WS_CHILD |WS_VISIBLE ,214,162,55,46
  CONTROL "Source Path",2,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,5,8,60,8
  CONTROL "Backup Type",3,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,5,47,60,8
  CONTROL "Target Path",4,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,5,20,60,8
  CONTROL "e.g. D:",5,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,85,32,23,8
  CONTROL "BLAZEPRO",6,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,113,32,48,8
  CONTROL "",7,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,109,32,2,8
  CONTROL "BACKUP",8,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,161,32,39,8
  CONTROL "[D]aily / [M]onthly",9,"STATIC",SS_LEFT |WS_CHILD |WS_GROUP |WS_VISIBLE ,101,47,73,8
  CONTROL "",10,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,75,17,135,12
  CONTROL "",11,"EDIT",ES_LEFT |WS_CHILD |WS_BORDER |WS_TABSTOP |WS_VISIBLE ,76,45,14,12
  CONTROL "Quit",12,"BUTTON",BS_DEFPUSHBUTTON |BS_VCENTER |BS_CENTER |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,217,321,50,14
  CONTROL "Tag All",13,"BUTTON",BS_PUSHBUTTON |BS_VCENTER |BS_CENTER |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,222,174,40,12
  CONTROL "Un-Tag All",14,"BUTTON",BS_PUSHBUTTON |BS_VCENTER |BS_CENTER |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,222,191,40,12
  CONTROL "Backup",15,"BUTTON",BS_PUSHBUTTON |BS_VCENTER |BS_CENTER |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,29,321,64,14
  CONTROL "Restore",16,"BUTTON",BS_PUSHBUTTON |BS_VCENTER |BS_CENTER |WS_CHILD |WS_TABSTOP |WS_VISIBLE ,119,321,64,14
}

With Regards,

Arindam
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Arindam,

The problem appears to be in the code defining oBacktWnd, however, I don't really think you need to use the "OF oWnd" clause of DEFINE DIALOG--I don't. Try changing these lines--take out the bold text:

DEFINE DIALOG oDlg RESOURCE "BACKREST" of oBacktWnd TITLE "BACKUP / RESTORE FUNCTION" Color "W/W"
...
ACTIVATE DIALOG oDlg ;
VALID oBacktWnd:End()

James
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Thankyou James for your suggestion. Thanks to Detlef for your efforts. I want to give special thanks to Antonio for his suggestion. His coding knowledge is realy un-predictable. Final solution comes from his advice.

Now it is working fine after doing the necessary modification in window.prg. After solving this problem, one more proble appears now. In listbox the result of ITEMS aDataFiles() are not showing any data. But while I click Tag All, it is selected and working according to next choice.

What could be the reason? Can you tell me?

With Regards
Arindam
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

Arindam,

you may NOT assign ID 0 for yor redesign statement of the listbox.

Try a higher value like i.e. 10
This should work.

Regards,
Detlef
Post Reply