Yes, you are right. It is dangerous to use it like that. If '|' are used in the path it fails.

I think the purpose would be more clear and effective with:
``` c++
GetDirectory(CStdString(strParent), strParent);
```

But using regular return values is even better! (like in my other PR)