Determine Current User
In Windows, the computer can be set up so that many different users can log into the computer. The current user
In Windows, the computer can be set up so that many different users can log into the computer. The current user
The following code is a fast way to compose a big string by using Mid$ function instead of using the concatenating operator. The strings concatenated in a loop are often
The following method returns a (DWORD)IPAddress from a(CString)IPAddress. It is quite useful when using the CIPAddressControl. DWORD CMyClass::GetDWORDIPAddress(CString strIPAddress){ strIPAddress.MakeReverse();// Start from behind char DOT = ‘.’; DWORD dwReturnValue =
There is an explicit form of output justification. In the following example, the keywords
Define a template function as shown below: template IsEqual(const Obj & obj1, const Obj & obj2){ return !(memcmp ( &(obj1),&(obj2),sizeof (Obj)));} It will be used as follows. Obj a;Obj b;if
You can overload ‘new’ and ‘delete’ operators, just like any other operator in C++, you just need to a hidden argument. operator ‘new’ requires an argument of type ‘size_t’ (if
The following example demonstrates how to have only one instance of a class at a time. class MySingleTon{public: static MySingleTon * GetObject() { static MySingleTon obj; return &obj; } …
In a big project involving several classes, logging error messages can be required. There are several ways to do this, but a simple approach is to open the log file
A generic approach to making sure a single quote (‘) does not cause a SQL statement to fail is to replace the single quote with two single quotes, as in