Solved

Trouble with resource definition

Posted on 1997-03-21
1
236 Views
Last Modified: 2013-12-03
Hi,

I am trying to create the 'Open' common dialog box and
I am using the sample code found in the help files of
the Microsoft Visual C++ 4.0 Standard Edition.  Part
of the code is as follows:

cbString = LoadString(hInst, IDS_FILTERSTRING, szFilter,
sizeof(szFilter));

Towards the end of the help, it says

The string referred to by the IDS_FILTERSTRING value is
defined as follows in the resource-definition file.

STRINGTABLE
BEGIN
    IDS_FILTERSTRING "Bitmap File(*.BMP)|*.bmp|"
END

Now, I assumed that I should include this IDS_FILTERSTRING
stuff in <projname>.rc file.

When I compile, I get a message saying that 'IDS_FILTERSTRING is an undefined keyword or key name' in .rc file.  Could someone tell me where I should define this ID?  Am I doing the right thing by including it in the <projname>.rc file?  Any help will be greatly appreciated.  Thanks in advance.  
0
Comment
Question by:raghu022597
1 Comment
 
LVL 2

Accepted Solution

by:
sapek earned 70 total points
ID: 1334196
If you are using a symbol value (like IDS_FILTERSTRING) in a recource file you must define the symbol in the resource header file (usually resource.h), for example:
#define IDS_FILTERSTRING 100
If you had added IDS_FILTERSTRING string using resource editor rather than by manually editing *.rc file, that would have been done automaticaly.
So to fix this either add the definition of IDS_FILTERSTRING to the header or better remove the stuff you added to *.rc file and add the string resource using resource editor.

Adam

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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