0

I have an MFC-based Windows application with a GUI, it is written in C++ and has a lot of COM objects; let's call it "HelloWorld".

A user sent me a bug report: sometimes, in response to a particular user action, a MessageBox shows up (in the following image I removed the title bar caption).

enter image description here

1) The title bar caption of the MessageBox is HelloWorld and, looking for that string in the code, it seems to me that the it is the resource string identified by AFX_IDS_APP_TITLE (in the .rc source file of the application); the following is the relevant section of the .rc source file:

STRINGTABLE
BEGIN
   AFX_IDS_APP_TITLE       "HelloWorld"
   AFX_IDS_IDLEMESSAGE     "..."
   AFX_IDS_HELPMODEMESSAGE "..."
END

2) On a Windows 7 with English laguage the message of the MessageBox is "Member not found."

3) In Windows 7 with different languages the message is translated in the proper language.

I think that the problem is described here HOWTO: Troubleshoot "Member Not Found" 0x80020003 Error and is related to the DISP_E_MEMBERNOTFOUND error; I actually solved the problem at the user site.

But there is a different problem that is still unsolved and it is a problem of user experience: the user who sent me the bug report is not a programmer and does not know the meaning of "member" in expression such as "member function" and so the user was slightly offended by the message because of the many meanings of the word "member" (at least in English and in Italian).

I checked the source code of the application and it seems to me that the MessageBox is not generated by the application; now I would like to know how that MessageBox is generated in order to intercept it and display a different MessageBox: is it possible to do?

Alessandro Jacopson
  • 18,047
  • 15
  • 98
  • 153
  • 2
    Seriously, are you really going to spend time on this? Maybe you should just tell the user he shouldn't be worried about losing his "member;" I'm quite certain he has no trouble finding it. – Robert Harvey Jan 21 '14 at 18:07
  • @RobertHarvey I am serious. – Alessandro Jacopson Jan 21 '14 at 18:08
  • So am I. This is not something you should be spending your time on; this is something you should be blaming Microsoft for. Anything is possible given enough time and money; the real question is, is it worth it, given that you've solved the problem already and it may never recur? – Robert Harvey Jan 21 '14 at 18:10
  • 1
    When the message appears, take a stack trace. That will tell you who is generating it. – Raymond Chen Jan 21 '14 at 20:15
  • @RaymondChen Thank you Raymond, I had that idea and launched Sysinternals' `procexp` at the user's site in order to have a look at the stacks traces of the threads. But `procexp` show me a message about a wrong version of `dbghelp.dll`, my available time for that issue was running out and so I gave up. – Alessandro Jacopson Jan 22 '14 at 17:14

1 Answers1

0

I don't know about the specific error, but to suppress message box, this is the windows call.

BOOL SetThreadErrorMode(
  _In_   DWORD dwNewMode,
 _Out_  LPDWORD lpOldMode
);

Prior to windows 7, use SetErrorMode.

m. c.
  • 867
  • 5
  • 12