Get Current Time in mm/dd/yyyy in C++

I am using the following code for setting the time in a Date Control in MFC using C++ This will get the Date and set it to the control in what ever format the user machine uses. But I want to set it to a format of ONLY mm/dd/yyyy. There should be some way of … Read more

LPCSTR, LPCTSTR and LPTSTR

To answer the first part of your question: LPCSTR is a pointer to a const string (LP means Long Pointer) LPCTSTR is a pointer to a const TCHAR string, (TCHAR being either a wide char or char depending on whether UNICODE is defined in your project) LPTSTR is a pointer to a (non-const) TCHAR string In practice when talking about these in the past, … Read more

error MSB3073: How do I fix this?

For anyone else that comes across this question my problem was that the target directory contained spaces i.e. So for me the solution was to wrap $(TargetDir) in double quotes i.e.

What is `CString`?

CString is neither a C nor a C++ type. It appears to be a Microsoft invention that is essentially an alternative to std::string: CString objects can grow as a result of concatenation operations. CString objects follow “value semantics.” Think of a CString object as an actual string, not as a pointer to a string. You can freely substitute CString objects for const char* and LPCTSTR function arguments. A conversion … Read more