Click here to Skip to main content
15,921,212 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Hi toxcct,


Actually your code does not compile, could you try please? I have tried twice. If there is any mistake I have made in the code, please feel free to let me know.

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


main.cpp(9) : error C2143: syntax error : missing '}' before ';'
main.cpp(9) : error C2143: syntax error : missing ';' before ','
main.cpp(12) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
main.cpp(12) : error C2040: 'p' : 'int' differs in levels of indirection from 'TCHAR *'
main.cpp(12) : error C2065: 'SecondArray' : undeclared identifier
main.cpp(13) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
main.cpp(13) : error C2040: 'p' : 'int' differs in levels of indirection from 'TCHAR *'
main.cpp(16) : error C2059: syntax error : 'return'
main.cpp(17) : error C2059: syntax error : '}'
main.cpp(17) : error C2143: syntax error : missing ';' before '}'
main.cpp(17) : error C2059: syntax error : '}'


regards,
George
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 
GeneralRe: my method to optimize application startup performance Pin
George_George21-Nov-07 21:23
George_George21-Nov-07 21:23 
GeneralRe: my method to optimize application startup performance Pin
jhwurmbach21-Nov-07 21:41
jhwurmbach21-Nov-07 21:41 

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.