Solved

Trouble with resource definition

Posted on 1997-03-21
1
232 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

6 Experts available now in Live!

Get 1:1 Help Now