   mingw-g++ and strsafe.h
  I tried to compile after including strsafe.h and got error after error of "expected primary-expression before ',' token."  After tooling around a bit, I found that mingw-g++ is choking on all the NULLs in strsafe.h.Does anybody know how a fix or workaround for this?   
  Since strsafe.h is "Safer String Handling in C" and g++ is a C++ compiler, why exactly are you wanting to use the former in the latter?  C++ already has perfectly safe string handling via the std::string class.If you are in one of the ~0.1% of situations where using strsafe.h makes sense, presumably you just need to ensure that NULL is defined, so include <cstddef> before strsafe.h.Σnigma   ;Quote:Original post by Enigmawhy exactly are you wanting to use the former in the latter?Because it has been my experience that Win32 functions that take LPTSTR (and similar) paramaters don't always play well with std::strings.I'd be happy to learn of a good alternative (other than MFC).Oh, and it's been nearly a year since I've even looked at code, so I'd forgotten about cstddef.  Thanks for the reminder.   ;  Any time you need to pass a string to a Win32 function you should be able to use a std::basic_string< TCHAR > by calling the c_str() member function.  Any time you need to pass a buffer to a Win32 function for the function to fill you should be able to use a std::vector< TCHAR >.  I'm not aware of any Win32 function where neither of those two techniques works and they are both superior to manual memory management.Σnigma   ;Quote:Original post by EnigmaAny time you need to pass a buffer to a Win32 function for the function to fill you should be able to use a std::vector< TCHAR >.Ah, that's the trick I needed.  Much thanks.