How the Windows MessageBox with message "Member not found." is generated? Is it possible to intercept it?

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?

c++
windows
com
mfc
idispatch

1 Answer

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.

answered on Stack Overflow Jan 21, 2014 by m. c.

User contributions licensed under CC BY-SA 3.0