0

It looks like compiler can't concatenate strings in resource file: for example:

STRINGTABLE 
BEGIN 
CTEXT "App Name: " "Notepad Super" " Viewer " 

I want "App Name: " and " Viewer " to be constant literals. And main name "Notepad" to be macro define. Compiler can't do it for rc file so I want to use preprocessor:

#define NAME_RC Notepad Super
CTEXT BOOST_PP_STRINGIZE(BOOST_PP_CAT(App Name: , BOOST_PP_CAT(NAME_RC, Viewer)))

And this way I obtain: App Name:Notepad SuperViewer

However macro takes only tokens and trims all leading or trailing whitespaces. How can i fix it? I want to have: App Name: Notepad Super Viewer

Best regards

xMRi
  • 14,982
  • 3
  • 26
  • 59
user7242858
  • 81
  • 1
  • 9
  • This is a possible duplicate to http://stackoverflow.com/questions/35057803/concatenate-string-and-constant-in-resource-file-in-c-mfc – xMRi Mar 06 '17 at 12:50
  • Possible duplicate of [Concatenate string and constant in resource file in C++ (MFC)](http://stackoverflow.com/questions/35057803/concatenate-string-and-constant-in-resource-file-in-c-mfc) – xMRi Mar 06 '17 at 12:50
  • http://stackoverflow.com/questions/12637325/concate-define-and-string-in-resources/12648021#12648021 – Christopher Oicles Mar 06 '17 at 15:20
  • Thank you Christopher, That solved my problem – user7242858 Mar 06 '17 at 15:47

0 Answers0