|
-
September 5th, 2012, 11:15 AM
#2
Re: Variables & WMI
 Originally Posted by Simoninman
This is my function:
Code:
WCHAR* WMIQuery(char* QueryName, char* ClassName, char* PropertyName, char* QueryArgument)
{
WCHAR* QueryResult;
...
return QueryResult;
}
You return a pointer to WCHAR that is defined locally within the WMIQuery() function.
But it goes out of scope just before this function returns, so the return value points to some garbage!
Either return CString (or std::wstring) objects or add additional parameter (WCHAR* QueryResult) in the argument list of the function.
Victor Nijegorodov
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|