Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trouble with resource definition

Posted on 1997-03-21
1
Medium Priority
?
253 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 140 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

782 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