Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot find resource string

Status
Not open for further replies.

Giordano

Programmer
Feb 17, 2004
24
IL
May be it is a stupid questions but I am a beginner in VC++
I wrote a small MFC dll that exports several classes.
I have a string table in my dll.

By when I call this classes from MFC executable, CString::LoadString failes to find this string id.

Any ideas?
 
Are you staticly linking? If so, you need to edit the resource includes of your dll resources. In the top portion include the .h file and in the bottom portion put the path the the .rc file.

To edit the resource includes, go to the resource tab and right click the resource.

Matt
 
Hi, Matt!
Thanks for your response.
I didn't understand which h and rc I need to include to my dll resources.

The problem is in Run time, not in compillation.

Thanks a lot.
Giordi.
 
at the compilcation you may specify LoadString(anything), this anything is not verified at compile time. In your dll if you create resources you should usualy #include "resource.h". This file is generated dinamycally. After that call LoadString with ID specified in resource.h, not in your own defines.

Ion Filipski
1c.bmp
 
You're aware that any method in your MFC dll thats called by some external gizmo should begin with a
Code:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
call? Otherwise the calling application's resource will be looked into (and that doesni hold the specified string I assume).

/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
Thanks a lot, Guys!
AFX_MANAGE_STATE(AfxGetStaticModuleState()); worked greate!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top