FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to debug abnormal program termination

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Tue May 22, 2007 6:27 pm    Post subject: how to debug abnormal program termination Reply with quote

Greetings.

I am working with DDBI and DFL. I am having a few problems where when I double_Click on a listview item I get "abnormal program termination". I start the program again and it works fine. I have placed a few msgBox, but when I do that, the program does not abort. So, I think that I must be doing something really fast where the listbox item is not ready for some reason. The listbox is huge, which may be the reason as to why, here is the list of it:
Code:
  private void initDesign()
  {
    ColumnHeader col;
    /* this is used to store the UniqueID row id */
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.width =0; // invisible for id
    lview.columns.add(col);
    //msgBox("lview col index = " ~ std.string.toString(col.index()));
         
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = " P-Id";
    col.width =40;
    lview.columns.add(col);
    //lview.columns.textAlign = dfl.base.HorizontalAlignment.LEFT;
    //msgBox("lview col index = " ~ std.string.toString(lview.columns.index()));
   
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "subPId";
    col.width =0; // invisible for ProjID
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "";
    col.width =0; // visible for parent which is really the project ID.
    lview.columns.add(col);
    //msgBox("lview col index = " ~ std.string.toString(col.index()));
         
    col = new ColumnHeader;
    col.width =0; // invisible for children
    lview.columns.add(col);
    //msgBox("lview col index = " ~ std.string.toString(col.index()));
         
    col = new ColumnHeader;
    col.width =0; // invisible for login
    lview.columns.add(col);
    //msgBox("lview col index = " ~ std.string.toString(col.index()));
         
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "  Program";
    col.width=65;
    lview.columns.add(col);
    //msgBox("lview col index = " ~ std.string.toString(col.index()));
   
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "                  Project";
    col.width=165;
    //col.textAlign = dfl.base.HorizontalAlignment.LEFT;
    lview.columns.add(col);
   
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = " PClass";
    col.width=64;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "PSubClass";
    col.width=68;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "StartDate";
    col.width=68;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "DueDate";
    col.width=68;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "EndDate";
    col.width=68;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "   PM";
    col.width=60;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "PM-UK";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "  Lang";
    col.width=55;
    lview.columns.add(col);
 
    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "Vendor";
    //col.textAlign = dfl.base.HorizontalAlignment.LEFT;
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "VEmail";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = " Invoice";
    col.width=55;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "  Fund";
    col.width=56;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "PMTime";
    col.width=48;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "A-Number";
    col.width=67;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "wDir";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "BiliDir";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "TMDir";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "DeliDir";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "paid";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "paidDate";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "Notes";
    col.width=0;
    lview.columns.add(col);

    col = new ColumnHeader;
    //col.textAlign = dfl.base.HorizontalAlignment.CENTER;
    col.text = "Status";
    col.width=20;
    lview.columns.add(col);
   
    lview.doubleClick ~= &lview_doubleClick; //on double_click event handling
    wDirDisplay.doubleClick ~= &wDirDisplay_doubleClick; //double_click event
    BiliDirDisplay.doubleClick ~= &BiliDirDisplay_doubleClick; //double_click event
    TMDirDisplay.doubleClick ~= &TMDirDisplay_doubleClick; //double_click event
    lblInvoice.doubleClick ~= &lblInvoice_doubleClick; //on double_click event
    lblFund.doubleClick ~= &lblFund_doubleClick; //on double_click event handling
    labbDate.doubleClick ~= &labbDate_doubleClick; //on double_click event handling
    labdDate.doubleClick ~= &labdDate_doubleClick; //on double_click event handling
    labeDate.doubleClick ~= &labeDate_doubleClick; //on double_click event handling
    fromSDate.doubleClick ~= &fromSDate_doubleClick; //on double_click event handling
    toSDate.doubleClick ~= &toSDate_doubleClick; //on double_click event handling
    ProjID.doubleClick ~= &ProjID_doubleClick; //on double_click event handling
    lblvEmail.doubleClick ~= &lblvEmail_doubleClick; //on double_click event handling
    lblPM.doubleClick ~= &lblPM_doubleClick; //on double_click event handling
    lblContact.doubleClick ~= &lblContact_doubleClick; //on double_click event handling
    lblPMTime.doubleClick ~= &lblPMTime_doubleClick; //on double_click event handling
    btnNew.click ~= &btnNew_click;
    btnEdit.click ~= &btnEdit_click;
    btnSave.click ~= &btnSave_click;   
    btnDelete.click ~= &btnDelete_click;   
    btnUpdateDB.click ~= &btnUpdateDB_click;   
    btnFind.click ~= &btnFind_click;
    btnAllJobs.click ~= &btnAllJobs_click;
    btnOpenJobs.click ~= &btnOpenJobs_click;
    btnOpenProjs.click ~= &btnOpenProjs_click;
    btnClosedJobs.click ~= &btnClosedJobs_click;
    btnReport.click ~= &btnReport_click;
    btnSubProject.click ~= &btnSubProject_click;
    btnwDirPath.click ~= &btnwDirPath_click;
    btnBiliDirPath.click ~= &btnBiliDirPath_click;
    btnTMDirPath.click ~= &btnTMDirPath_click;
    btnDeliDirPath.click ~= &btnDeliDirPath_click;
    lview.keyDown ~= &lview_keyDown;
    LSOpenProjs.keyDown ~= &LSOpenProjs_keyDown;
    //this.keyDown ~= &parent_keyDown;
    buttons.keyDown ~= &buttons_keyDown;
    find.keyDown ~= &find_keyDown;
    btnNew.keyDown ~= &btnNew_keyDown;
    btnSave.keyDown ~= &btnSave_keyDown;
    btnDelete.keyDown ~= &btnDelete_keyDown;
    btnUpdateDB.keyDown ~= &btnUpdateDB_keyDown;
    btnFind.keyDown ~= &btnFind_keyDown;
    btnAllJobs.keyDown ~= &btnAllJobs_keyDown;
    btnOpenJobs.keyDown ~= &btnOpenJobs_keyDown;
    btnOpenProjs.keyDown ~= &btnOpenProjs_keyDown;
    btnClosedJobs.keyDown ~= &btnClosedJobs_keyDown;
    btnReport.keyDown ~= &btnReport_keyDown;
    btnSubProject.keyDown ~= &btnSubProject_keyDown;

    /+
    btnReport.click ~= &btnReport_click; +/
    //msgBox("lview col Length = " ~ std.string.toString(lview.columns.count()));
  }


so, I think, and I am no Windows Programming Expert, that when I double click on that item and it is suppose to fill all of this values,
Code:

    UniqueID              = lview.focusedItem.text; // set the record number;
    IDlabel.text          = UniqueID;
    ProjID.text           = lview.focusedItem.subItems.opIndex(0).text;   // ProjID
    subProjID.text        = lview.focusedItem.subItems.opIndex(1).text;   // subProjID
    Parent                = lview.focusedItem.subItems.opIndex(2).text;   // parent
    Children              = lview.focusedItem.subItems.opIndex(3).text;   // Children
    login                 = lview.focusedItem.subItems.opIndex(4).text;   // login
    txtCust.text          = lview.focusedItem.subItems.opIndex(5).text;   // Cust
    txtProj.text          = lview.focusedItem.subItems.opIndex(6).text;   //
    PClass.selectedIndex(PClassInt[lview.focusedItem.subItems.opIndex(7).text]);      // Class
    ProjBranch.selectedIndex(PSubClassInt[lview.focusedItem.subItems.opIndex(8).text]); // Class
    txtbDate.text         = lview.focusedItem.subItems.opIndex(9).text;   //
    txtdDate.text         = lview.focusedItem.subItems.opIndex(10).text;   //
    txteDate.text         = lview.focusedItem.subItems.opIndex(11).text;   //
    txtPM.text            = lview.focusedItem.subItems.opIndex(12).text;    //
    txtPMUK.text          = lview.focusedItem.subItems.opIndex(13).text;    //
    txtLang.text          = lview.focusedItem.subItems.opIndex(14).text;    //
    txtVendor.text        = lview.focusedItem.subItems.opIndex(15).text;    //
    vEmail.text           = lview.focusedItem.subItems.opIndex(16).text;    //
    txtInvoice.text       = lview.focusedItem.subItems.opIndex(17).text;    //
    txtProjFund.text      = lview.focusedItem.subItems.opIndex(18).text;    //
    PMTime.text           = lview.focusedItem.subItems.opIndex(19).text;    //
    txtA_No.text          = lview.focusedItem.subItems.opIndex(20).text;    //
    wDirDisplay.text      = lview.focusedItem.subItems.opIndex(21).text;    //
    BiliDirDisplay.text   = lview.focusedItem.subItems.opIndex(22).text;    //
    TMDirDisplay.text     = lview.focusedItem.subItems.opIndex(23).text;    //
    DeliDirDisplay.text   = lview.focusedItem.subItems.opIndex(24).text;    //
    txtPaid.text          = lview.focusedItem.subItems.opIndex(25).text;    //
    paidDate.text         = lview.focusedItem.subItems.opIndex(26).text;    //
    txtNotes.text         = lview.focusedItem.subItems.opIndex(27).text;    //
    txtStatus.text        = lview.focusedItem.subItems.opIndex(28).text;    //
    PMTime.text = calculatePMTime();


Some of those values are not set yet, and the program aborts. I could provide you with the code and data so that you can see it. It happens all the time. However, if I slowly click on the item, it happens less. But the faster I do it, the more it happens. Just trying to figure out if it is DDBI or DFL.

Any ideas?

jose
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Wed May 23, 2007 4:58 am    Post subject: Re: how to debug abnormal program termination Reply with quote

I don't know what's wrong. Have you tried using a debugger?

windbg is quite easy to use, if you can work around its instability; compile with -debug -g, type windbg foo.exe, hit F5, trigger the problem in your program, and it should break at it. Use windbg's Window menu to show the Calls and anything else.
Back to top
View user's profile Send private message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Wed May 23, 2007 11:52 am    Post subject: Reply with quote

Ok. I will give that a try.

thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group