How to Share a Handle Between Two Threads
Whenever a handle is passed to another thread, use the DuplicateHandle API to create a duplicate handle to the same object and pass this duplicated handle to the thread. That
Whenever a handle is passed to another thread, use the DuplicateHandle API to create a duplicate handle to the same object and pass this duplicated handle to the thread. That
Using a variable when loading a control in a control array simplifies the code and makes it run faster.Example:1) Create a new standard EXE project.2) Add a Label to Form1.3)
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; } …