c++ - MFC - Manually expand stringtable -


can provide explanation or link explains how stringtable in mfc resource file defined , can manually expanded?

i tried it, failed in multi project solution. projects in said solution have own resource files , renamed resource.h-files.

when application tries access string resources, error message 'resource string '22392' not found' shows up. 22392 id of string tried create. don't similar error message if use defined string id instead.

using visual studio 2010's wizard add string resource didn't work either. shows correctly in listing of resource symbols , in string table editor.

needless haven't participated in creation of solution.

thanks help.

[edit1]

i excluded possibility of conflict performing ‘find in files’ value used , using other values well: 22390, 22391, 22393, 22394, 22395. got same result.

[edit2]

i repeated steps did in complex solution in new, clean , simple mfc application 1 project , worked without problems. therefore assume problem related fact solution has multiple projects , resources.

the steps following:

  1. pick free number in resource.h (which named differently in case) , add #define ids_xxx free number.
  2. validate chosen number performing ‘find in files’ it.
  3. add line stringtable in resource.h, preferably close ids_ value close 1 picked.

    stringtable begin   ids_other          "i have number close xxx"   ids_xxx            "hellohello" end 
  4. access string in application:

    cstring strmystring; strmystring.loadstring(ids_xxx);  afxmessagebox(strmystring, mb_yesno | mb_iconexclamation); 

[edit3]

i tried locate call of loadstring causes error message. loadstring fails load string resource located in class, in same project resource file (.rc) containing said string resource. error message 'resource string '22392' not found' generated there. explains @ least why found nothing googeling it.

[edit4]

i isolate cause further.

in cstringt.h hinst null aka string ressource can't found:

_check_return_ bool loadstring(_in_ uint nid) {     hinstance hinst = stringtraits::findstringresourceinstance( nid );     if( hinst == null )     {         return( false ); // goes here, shouldn't, hinst == null     }     return( loadstring( hinst, nid ) ); } 

this strange since possible access string ressource within same resource file fine.

the "resource string '22392' not found" error sounds windows cannot find specific string in string table although conflicts statement "but shows correctly in listing of resource symbols , in string table editor". few things or check narrow down issue:

  • clean/rebuild entire project , or solution. i've seen strange behaviour vs due bad or out of date builds first thing try.
  • edit rc file in text editor: right-click on rc file , "view code" in vs2010. confirm string 22392 present , valid. check entries before , after well.
  • delete string string table , resource.h. re-create string resource editor.
  • you mention "renamed resource.h files". i'm not entirely sure mean make sure these used in rc file: should included @ top when looking @ in text editor.
  • make sure defined name 22392 not redefined somewhere else in project.

if string present in string table , still "not found" error else going on.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -