Pointer returning problem

Started by
11 comments, last by Craazer 21 years ago
Just don''t forget to deallocate that string somewhere. Probably in the function that''s calling GetFilename.

Another approach could be to use std::string objects and pass by reference or value.
Advertisement
How about making the OPENFILENAME struct static?
You won''t have to deallocate anything afterwards, but you''d better make sure you''re done with the string before calling GetFilename() again (it will be overwritten).
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3
Quicky fix:
return strdup(browsedfile.lpstrFileTitle);

And remember to free it afterwards

This topic is closed to new replies.

Advertisement