If we break this command into its constituent parts we get the following:
-I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys";
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys"
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include"
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
(35) : fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory
The only directories included by the -I option are "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys" and . (dot). All the other directory names seem to be orphaned in the command line. I'm also not sure why "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sys" has that semi-colon character after it. I think you need to check your NMAKE source file.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
1. Yes that could be the intention, but the compiler would look there in any case, wouldn't it?
2. So then we know it took me more than 36 minutes to type in that comment. No wonder I'm not a regular...
Is it safe to pass CComVariant declared locally to other function
1. Can I pass the CommVariant to other function, when not created using new ?
2. Should I free it/delete expecitly some where ?
3. Is it safe ? any precauions ?
You must also check the vt member. When expecting a boolean value, it must be VT_BOOL. When the requested property exists but did not contain a value, VT_EMPTY or VT_NULL are returned (the return type depends on the property value type).
The result of an expression is temporary, and it is destroyed an the and of the expression evaluation.
In your first case, you are getting a temporary string as a result of s1+s2, whose buffer pointer is saved in s. After that, the expression finish, the temporary is destroyed, and so it is its buffer and s is left dangling. You had been lucky in having printed nothing. accessing a deleted buffer can even result in a crash.
In your second example, the temporary string resulting from s1+s2 is kept alive until the expression it belongs ( cout<<(s1+s2).c_str()<<endl; ) is evaluated. Hence its buffer (renturned from c_str()) is still there at the time its pointer is given to cout.
Your first sample works correctly if you retain the string:
void SetStr(string& s1, string& s2)
string ss; //the place to store the result
ss = s1+s2; //the result of s1+s2 is moved to ss, that survives the expression itselfconst char* s = ss.c_str(); //ss buffer pointer obtained
cout << s << endl; //your original cout
The original problem that lead to the question was that when the program running in the process was canceled, or halted due to a requirement missing, the cosmetic loop would still be running, instead of exiting and sending the appropriate message to the message pump to go to the next stage. So I added the GetExitCode to double check that the process was still running, or if the process had been halted.
Just didn't think my quick fix was the correct way to check, and just wanted to do it right.
Last Visit: 31-Dec-99 19:00 Last Update: 6-Dec-23 20:42