Determine Languages defined in .rc file in C++ MFC project - Stack Overflow

I have inherited some really old MFC code and need to add some additional functionality.I have figure

I have inherited some really old MFC code and need to add some additional functionality. I have figured out how to manually set the language- and due to items beyond my control- I am defining the languages in the .rc file. I do not have multiple .rc or .rc2 files- and am not allowed to go the path of a .rc2 file or even an additional dll. The .rc file is included in the executable.

I am trying to determine how to know what languages are available at runtime in the .rc file. The below example is

I would like to something like this:

int main()
{
if (IsLanguageDefined("test.rc","French"))
    //Do Something here
}

bool Test::IsLanguageDefined(const CString& filePath, const CString& language) {
//I dont believe this is anywhere near correct- so five the pseudo lanugage
return (EnumResourceLanguagesA(test.rc, ??,??,language,??);
}
test.rc:
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRE)
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
//resources defined here
#endif

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN 0
#pragma code_page(1252)
//resources defined here
#endif

What is the best way to determine what languages are in my .rc file? Can you give me a code sample? Thank you!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744223378a4563889.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信