Static link MFC causes String Table collision?

My app links with MFC as a DLL just fine.  When I link it with "MFC statically linked" then I get some errors which seem to have to do with the attempt to redefine strings.  I have
a pretty big string table, and the entries in the string table whoose IDs
are above 61440 (which is 0xF000) start
colliding with stuff in MFC/INCLUDE/afxres.rc (for example AFX_IDS_OPENFILE seems to want to use
ID 61440). If I remove the entries in my
string table that are at 61440 and higher, then it builds OK.

Can someone explain what is going on and
how I can get around this?  I'd like to
have stuff in my string table above 61440, and as my app is not yet complete, I may wish to add even more stuff in the string table...

tullheadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

luisrCommented:
The problem is that MFC uses strings above 61440. When you link with the DLL version of MFC, those strings are in the DLL itself, so you can use those IDs for your own app inside your executable file.

When you link MFC statically, those same strings must go somewhere, and they go inside your own EXE, that is why you cannot add strings above that ID, or your app will function improperly.

The fix: renumber your strings or don't link with MFC statically.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tullheadAuthor Commented:
Looking at my String Table (and I'm not
sure how it got this way) there are large gaps in the ID numbers used, for
example one entry uses 1002, and the
next uses 32771.  Also, one uses 32792
and the next one uses 57344.

So perhaps I'll move some of my strings
into those "gaps".

But before I do, are there other restrictions or other "collisions" with
MFC awaiting me?  Am I free to use any
of these IDs below 61440?

Also, is there some way to tell MFC to
start its ID use at a number higher
than 61440?

Thanks...
0
luisrCommented:
There is no easy way to modify MFC's strings... You would have to edit internal header files and source code and recompile it.
0
ZoppoCommented:
Hi tullhead:

>are there other restrictions or other "collisions" with MFC awaiting me?
see MSDN article 'TN020: ID Naming and Numbering Conventions' ...

ZOPPO
0
tullheadAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.