I want to send a pointer string (c-type strings only, please) to a function and have that function fill the pointer string. I know I can do this by casting the function itself as a string, but I want the function to return a BOOL instead of a string. I have tried something like this...
1 2 3 4 5 6 7
BOOL ParentFunction()
{
char* chStr=NULL;
(do stuff)
ChildFunction(hWnd, chStr);
Then in the child function...
1 2 3 4 5
BOOL ChildFunction(HWND hw, LPSTR lpString)
{
(allocate memory and fill string)
return TRUE;
However, this doesn't affect chStr in ParentFunction();
What I want is to have ChildFunction() fill the string and pass that data back in the parameter.
Also, I'm assuming that if I allocate memory in ChildFunction() that I can then free it in ParentFunction(), if I can get it to work, that is.