• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 456
  • Last Modified:

TInputDialog "Execute Fail" error.

I am somewhat new to windows programming.

I have a project that uses a TInputDialog instance to ask for a simple piece of information.  All worked well until about 2 weeks ago.  My resource file got corrupted and
I had to rebuild much of it.  As I recall (and in looking back at the last good copy of the resource file) there is nothing (except the includes for the inputdia.rh & inputdia.rc files) needed in the resource file for TInputDialog.

Now I receive the following error messagebox when Execute is called for the object:

"ObjectWindows Exception
 Execute fail for window Input the Date for Delete Records
 OK to resume?
 yes   no"

One other problem I just noticed (that is surely related), I get a similar error message on my call to a TPrinter object.  ("Create" fail and no window name.) -- I haven't looked closely at the TPrinter code but I'm sure it is creating a simple dialog to show print progress.

I receive no errors/warnings on compile & link.  All else seems to operate properly, even other TDialog objects I use.

Code sample:
============
My resource file contains the owl\inputdia.rh and owl\inputdia.rc includes.


#include <owl\inputdia.h>
void ReportsWnd::CmDelRecs()
{
        char high_date[12];

        TInputDialog* dialog = new TInputDialog(this, "Input            the Date for Delete Records",
           "Delete the records before and on (MM/DD/YYYY):",
           high_date, sizeof(high_date));
       
        int result = dialog->Execute();

        if (result == IDOK)
        {
        }
}
0
btenney
Asked:
btenney
1 Solution
 
costyaCommented:
Could it be that your resources are not bound to the exe file? Could you inadvertently delete the resource file from the project?
Try opening the resource file in Workshop and check for the input dialog and print progress dialog to be present. Check if you have overriden the item ID values for those dialogs in some of your sources.

Hope this will help.
Costya.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now