Re: who build this program?
- From: "Helge Kruse" <Helge.Kruse-nospam@xxxxxxx>
- Date: Tue, 1 Feb 2011 09:22:34 +0100
Assuming you use PlatformBuilder 6, a plug in for VS2005 ....
see inline.
"ydlu" <yudiannlu@xxxxxxxxx> wrote in message
news:1c637785-a517-4958-964c-eb4866b4a75b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In our group, six developer, so our project had a lot of "intern"Ok, this is a check that your USERNAME is MYNAME.
build, to we can test it, how can we pass the "username" - environment
variable, into program and show this username.
In Command prompt:
set username
USERNAME=MYNAME
- then set on the project propertyYes, you pass the -DUNAME=$(USERNAME) to the compiler when you add this line
UNAME=$(USERNAME)
to the "Preprocessor Definitions" of the C++ properties.
- define in C programNo. This does not work. Use this instead:
#define username(x) L#x
#define WSTR(s) L#s
#define username(u) WSTR(u)
You need the second macro definition.
Well, if you plan to use the TEXT macro, even if Windows CE uses always
void printUserName()
{
_tprintf(TEXT("%s\n"), username(UNAME));
}
Unicode strings, you should consider to define username this way:
#define TSTR(s) _T(#s)
#define username(u) TSTR(u)
But I would replace _tprintf by wprintf.
Helge
.
- Next by Date: Get Good Jobs In AUSTRALIA
- Next by thread: Get Good Jobs In AUSTRALIA
- Index(es):
Relevant Pages
|