?
Solved

Error: failed to load message box prompt string (AfxMessageBox, Loadstring)

Posted on 1997-09-17
3
Medium Priority
?
769 Views
Last Modified: 2008-03-06
I use VC++ 4.0 and I have two .RC file for the same resource.h file. Actually, one is for the french resources and the other for the english ones.

Yes, I admit it, maybe I modified in a text editor either the .RC or resource.h files! But as a result, I get an assertion failure in line 177 of appui.cpp telling me the specified string resource has not been found. The call is made by AfxMessageBox to pop up a dialog box displaying the message identified by a string resource. In fact, all resources not called by AfxMessageBox work fine.

My app used to worked just fine before I started playing with my resource files, so I'm convinced it's not the code which is wrong.

I believe that if I redefine all resources from scratch will do the job, but since there are quite a bunch of them, what can I do to restore my resources files in an uncorrupted state?

Thanks!
0
Comment
Question by:asselin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1169996
Why don't you tell us what id string resource was not found?

If it is a standard resource, you can may be able to get it from prompts.rc and/or afxres.rc

But cannot help much without the ID number.

Roger

0
 
LVL 3

Accepted Solution

by:
msmits earned 400 total points
ID: 1169997
The message identified by the MACRO in your LoadString() function call is probably not in the resource file you are using.
You should get the number from the resource.h file and verify that it in the .rc file that you are compiling and linking to your program.
0
 
LVL 1

Author Comment

by:asselin
ID: 1169998
It's a string resource I created myself and when I open my rc file and resource.h files, I can see the resource number and identifier. While debugging, I tried to replace the string identifier with another one I had created before: the same error message appears. And guess what, this resource string is found when displayed as a description of a button in the toolbar. So it seems like it's not a particular string resource which is not found but rather any string resource called by AfxMessageBox and LoadString. By the way I use the T_ macro:

AfxMessageBox (T_(mystring.LoadString(IDS_MY_STRING),...

As I said before, this line of code used to work and only my resource files have been updated.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question