I wrote a simple .cpp file that gets a windows username using:
char *username = getenv("USERNAME");
cout << username;
The result is the username that i want, however when i create this file as a cfx and access it from cold fusion i get a NULL value. Is this a CFMX issue with anything non-string based sent back to it, meaning that when I send a regular string value, the output .cfm file prints the value to the screen. However when i send the generated value listed below, I get an error. Can anyone help me? I followed the instructions on how to create a cfx file, but nothing gives me a simple explanation on how to just return a simple char value.
This is what i entered:
#include....
...
void ProcessTagRequest( CCFXRequest* pRequest )
{
try
{
char *varUserName = getenv("USERNAME");
pRequest->SetVariable( "varTest", varUserName);
...
}
}
Thanks,
Joe
p.s. using CFMX 6.1
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

