[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 1997-09-17
3
Medium Priority
?
772 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

656 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