Click here to Skip to main content
15,918,211 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Smarter ways to define MACRO to strings? Pin
jhwurmbach22-Nov-07 2:51
jhwurmbach22-Nov-07 2:51 
GeneralRe: Smarter ways to define MACRO to strings? Pin
toxcct22-Nov-07 4:18
toxcct22-Nov-07 4:18 
GeneralRe: Smarter ways to define MACRO to strings? Pin
George_George22-Nov-07 18:21
George_George22-Nov-07 18:21 
GeneralRe: Smarter ways to define MACRO to strings? Pin
jhwurmbach22-Nov-07 21:27
jhwurmbach22-Nov-07 21:27 
GeneralRe: Smarter ways to define MACRO to strings? Pin
George_George22-Nov-07 21:50
George_George22-Nov-07 21:50 
GeneralRe: Smarter ways to define MACRO to strings? Pin
jhwurmbach22-Nov-07 21:53
jhwurmbach22-Nov-07 21:53 
GeneralRe: Smarter ways to define MACRO to strings? Pin
George_George22-Nov-07 22:10
George_George22-Nov-07 22:10 
GeneralRe: Smarter ways to define MACRO to strings? Pin
George_George22-Nov-07 1:23
George_George22-Nov-07 1:23 
Hi toxcct,


Your code does not compile. Have I correctly applied your ideas?

<br />
#define PREFIX(x) _T("FOO")##x<br />
<br />
int main()<br />
{<br />
<br />
	const TCHAR* SecondArray [2] = {_T("FILE1"), _T("FILE2")};<br />
<br />
	TCHAR* p = NULL;<br />
	p = PREFIX(SecondArray [0]);<br />
	p = PREFIX(SecondArray [1]);<br />
<br />
<br />
	return 0;<br />
}<br />


Compile error,

main.c(11) : error C2146: syntax error : missing ';' before identifier 'SecondArray'
main.c(12) : error C2146: syntax error : missing ';' before identifier 'SecondArray'


regards,
George
GeneralRe: Smarter ways to define MACRO to strings? Pin
toxcct22-Nov-07 2:45
toxcct22-Nov-07 2:45 
GeneralRe: Smarter ways to define MACRO to strings? Pin
George_George22-Nov-07 18:24
George_George22-Nov-07 18:24 
GeneralRe: Smarter ways to define MACRO to strings? Pin
toxcct22-Nov-07 21:12
toxcct22-Nov-07 21:12 
GeneralBe patient... Pin
CPallini22-Nov-07 21:21
mveCPallini22-Nov-07 21:21 
GeneralRe: Be patient... Pin
toxcct22-Nov-07 21:24
toxcct22-Nov-07 21:24 
GeneralRe: Be patient... Pin
CPallini22-Nov-07 21:55
mveCPallini22-Nov-07 21:55 
GeneralRe: Smarter ways to define MACRO to strings? Pin
George_George22-Nov-07 21:47
George_George22-Nov-07 21:47 
QuestionHow to change window size Pin
Max++21-Nov-07 20:49
Max++21-Nov-07 20:49 
AnswerRe: How to change window size Pin
baerten21-Nov-07 21:04
baerten21-Nov-07 21:04 
AnswerRe: How to change window size Pin
prithaa21-Nov-07 21:10
prithaa21-Nov-07 21:10 
AnswerRe: How to change window size Pin
Hamid_RT21-Nov-07 21:11
Hamid_RT21-Nov-07 21:11 
GeneralRe: How to change window size Pin
prithaa21-Nov-07 21:30
prithaa21-Nov-07 21:30 
GeneralRe: How to change window size Pin
Hamid_RT21-Nov-07 21:38
Hamid_RT21-Nov-07 21:38 
GeneralRe: How to change window size Pin
prithaa21-Nov-07 22:14
prithaa21-Nov-07 22:14 
GeneralRe: How to change window size Pin
Hamid_RT22-Nov-07 0:21
Hamid_RT22-Nov-07 0:21 
Questionmy method to optimize application startup performance Pin
George_George21-Nov-07 20:39
George_George21-Nov-07 20:39 
AnswerRe: my method to optimize application startup performance Pin
jhwurmbach21-Nov-07 21:11
jhwurmbach21-Nov-07 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.