Modifying string resources during runtime 
Author Message
 Modifying string resources during runtime

Is it possible to modify strings in the resource string table during
runtime?

Appreciate any help
Roland



Sun, 15 Jul 2001 03:00:00 GMT  
 Modifying string resources during runtime
I know! The problem is, I want to change the string resource
AFX_IDS_APP_TITLE, which was generated by the AppWizard. This string is the
title of my application. It is used by the MFC framework. Therefore, I
cannot make my own CStringArray.

Another solution for my problem would be, if I could use conditions
(preprocessor definitions) for the stringtables in the resources. This works
with all the other types of resources (Toolbar, Dialog,...), but not with
strings. If I could use conditions, I could compile different versions of my
app with different strings for the same id (AFX_IDS_APP_TITLE).

Do you know, how I can use conditions with stringtables?

Thanks in advance
Roland

Quote:

>Roland,

>I don't think that is possible. All your resources are compiled into your
>executable. Best you can do is copy them all out into a CStringArray and
>alter them in that, but then you lose the resource id moniker.

>    Simon


>>Is it possible to modify strings in the resource string table during
>>runtime?

>>Appreciate any help
>>Roland



Mon, 16 Jul 2001 03:00:00 GMT  
 Modifying string resources during runtime
Roland,

I don't think that is possible. All your resources are compiled into your
executable. Best you can do is copy them all out into a CStringArray and
alter them in that, but then you lose the resource id moniker.

    Simon

Quote:

>Is it possible to modify strings in the resource string table during
>runtime?

>Appreciate any help
>Roland



Mon, 16 Jul 2001 03:00:00 GMT  
 Modifying string resources during runtime
Roland:

Yes you can, but you need to put it in the .rc2 file. Just remove
AFX_IDS_APP_TITLE from the resources and put this code in the .rc2 file:

#ifdef CONDITION_1

STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE       "Title1"
END

#else

STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE       "Title2"
END

#endif

You can put other strings in here too, like IDR_MAINFRAME, if you need to.

HTH,

David Wilkinson

===================

Quote:

> I know! The problem is, I want to change the string resource
> AFX_IDS_APP_TITLE, which was generated by the AppWizard. This string is the
> title of my application. It is used by the MFC framework. Therefore, I
> cannot make my own CStringArray.

> Another solution for my problem would be, if I could use conditions
> (preprocessor definitions) for the stringtables in the resources. This works
> with all the other types of resources (Toolbar, Dialog,...), but not with
> strings. If I could use conditions, I could compile different versions of my
> app with different strings for the same id (AFX_IDS_APP_TITLE).

> Do you know, how I can use conditions with stringtables?

> Thanks in advance
> Roland


> >Roland,

> >I don't think that is possible. All your resources are compiled into your
> >executable. Best you can do is copy them all out into a CStringArray and
> >alter them in that, but then you lose the resource id moniker.

> >    Simon


> >>Is it possible to modify strings in the resource string table during
> >>runtime?

> >>Appreciate any help
> >>Roland



Mon, 16 Jul 2001 03:00:00 GMT  
 Modifying string resources during runtime
Guys,

This pre-compile information is useful. I'm gonna remember it.

    Simon

Quote:

>Is it possible to modify strings in the resource string table during
>runtime?

>Appreciate any help
>Roland



Mon, 16 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How To change a LTEXT Resource during runtime?

2. How To change a LTEXT Resource during runtime?

3. Modify string resources in a DLL

4. Change String Table resource in runtime

5. Controls to move and dock during runtime.

6. Change mdi background during runtime

7. How to create a progressBar dynamically during runtime?

8. const object initialized during runtime

9. value of struct member changes during runtime

10. Creating tables during runtime

11. Using debugger during runtime

12. obtaining call stack information during runtime

 

 
Powered by phpBB® Forum Software