Solved

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

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

746 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

9 Experts available now in Live!

Get 1:1 Help Now