How to fix crashes in release builds or how to enable debug information in release builds for VC projects?

I will explain very briefly, how to fix crashes in release builds of VC applications. Difference between debug and release builds Well so what’s the difference between release and debug builds? The only major difference is that debug builds are for debugging purpose and release builds are for end users so for this purpose debug […]
Continue reading…

 

Some interesting uses of count_if stl algorithm function!

STL algorithm count_if function is a fun function with some serious usages associated with it. Main benefit of using count_if is that we can use normal character arrays/pointers along with normal CRT functions like isupper, islower etc. Using count_if to get count of lower/upper case characters in a string Just one function call and we […]
Continue reading…

 

Converting CString to LPCTSTR or LPTSTR

Converting from CString to char* is conditional, becuase CString is a TCHAR based implementation. TCHAR is defined as a char if _UNICODE is not defined, so if this is the case we can convert to char*, since TCHAR* and char*  are equal, else we’ve got to use function like MultiByteToWideChar/W2A/W2AEX etc. So from now on […]
Continue reading…

 

How to trim white space before and after a string?

I will describe in this post three ways to trim a string of given characters… Using custom function for std::string Using CString Using StrTrim shell API function. Using custom function for std::string Its bit strange that std::string doesn’t provide a Trim function 😕 , but hey since we’ve got head upon our shoulders we’re gonna […]
Continue reading…