| Lamblion (642) | |||||
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...
Then in the child function...
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. | |||||
|
Last edited on
|
|||||
| Ogoyant (153) | |||
How about passing the LPSTR by reference? Like this:
| |||
|
Last edited on
|
|||
| Lamblion (642) | |
| Thanks a bunch. I didn't even know you could do that. But it works like a charm, just like I wanted. | |
|
|
|
| Ogoyant (153) | |
|
Glad to know and to be of help. Ogoyant | |
|
|
|