title: Anyway to call CoInitialize() before an initialization list?
body: <p>Here is my C++ code of a constructor of ThorDetectorSwitch.cpp file:</p>
  
  <pre><code>ThorDetectorSwitch::ThorDetectorSwitch() : _mcSwitch(__uuidof(MCLControlClass))
  {
      _A  = WstringToBSTR(L"A"); 
      _B  = WstringToBSTR(L"B");
      _C  = WstringToBSTR(L"C");
      _D  = WstringToBSTR(L"D");
  
      _deviceDetected = FALSE;
  }
  </code></pre>
  
  <p>As you can see, an initialization list, <code>_mcSwitch(__uuidof(MCLControlClass))</code>, is used to initialize a COM object (MCLControlClass, which is registered from a COM dll). </p>
  
  <p>I am wondering is there anyway I can call CoInitialize() before this initialization list? Because I am getting exceptions of "CoInitialize() has not been called". Or any other way to avoid this exception?</p>
  
  <p>Thanks a lot.</p>