Thank you for your help. We figured out what the issue was and I'll share it here as it was an a very subtle issue that ended up affecting several other areas of our program. We use a 3rd party library called LeadTools to do some image processing. We have not upgraded it since 2001. It turns out that it was not behaving correctly when new threads were being called. When one of their DLLs received the DLL_THREAD_ATTACH it would execute some code that was blowing up in some cases. We were able to remove that part of LeadTools and now things are working fine again.