Solving "Unexpected Store Error" in Exchange

Getting a weird COM Exception with the cryptic ID 0×8055001E?
We’ve been struggling with this problem for over a year now, and we finally have a solution.
We have some critical code that is contacting Exchange server via COM Interop and CDOEX.DLL to read some inboxes and process e-mails. About once a month or so, we get [...]

Popularity: 4% [?]

Why you shouldn’t catch System.Exception

There are probably many reasons, but my favorite is that, if you are resorting to catching anything at all, you probably don’t understand the code well.
For example, in complicated parsing of text, it is often easier to just put a huge try {…} catch (Exception ex) {…} around the entire thing, rather than take the [...]

Popularity: 1% [?]

ArgumentNullException and ArgumentException

Does it strike anyone else as ironic that ArgumentException and ArgumentNullException have mismatched argument ordering? The parameter name is first for the null version, but second for the other one. Uggh… this makes it awkward to remember if you use both. ArgumentOutOfRangeException follows the example of ArgumentNullException.
I can see no obvious reason for the discrepancy. [...]

Popularity: 1% [?]

Threads in MFC Part III: Exceptions, Suspense, Murder, and Safety

Exceptions
In the previous tutorial, I described the various synchronization objects you can use to control access to shared objects. In most cases, these will work fine, but consider the following situation:
[code lang="cpp"]
UINT ThreadFunc(LPVOID lParam)
{
::criticalSection.Lock();
::globalData.DoSomething();
SomeFunctionThatThrowsException();
::criticalSection.Unlock();
return 0;
}[/code]
What’s going to happen when that exception gets thrown? The critical section will never be unlocked. If you start the thread [...]

Popularity: 1% [?]

Threads in MFC II: Synchronization Objects

Introduction
In part I, I looked at getting threads communicating with each other. Now let’s look at how we can manage how multiple threads operate on single objects.
Let’s take an example. Suppose we have a global variable (or any variable that is accessible to two or more threads via scope, pointers, references, whatever). Let’s say this [...]

Popularity: 12% [?]

Threads in MFC I: Worker Threads

There are two types of threads in MFC. Worker and User Interface. Here, I will discuss how to use a worker thread.First, let’s discuss some multi-threading basics. Each application has what we call a process. Usually, an application has only one process. This process defines all the code and memory space for the application. You [...]

Popularity: 11% [?]