Solved

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

Posted on 1997-09-17
3
740 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
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 200 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

  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 …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now