Solved

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

Posted on 1997-09-17
3
757 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 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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 138
Problem with SqlConnection 4 184
How to determine if the result of an equation is an integer in C++? 3 29
Coding for the first time 9 70
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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

726 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