title: dia2dump.exe -- HRESULT = 806d000c
body: <p>I'm wanting to get some information from a dll a program I'm debugging is linked to:
  So - I noticed that my debugger downloaded a pdb for a library where a crash happens, and I tried to run dia2dump on it:</p>
  
  <p>dia2dump -all mfc90.i386.pdb\05089943A3B2462891FBF83E29A72618E\mfc90.i386.pd_</p>
  
  <p>But dia2dump replies:</p>
  
  <p>loadDataForExe failed - HRESULT = 806d0012</p>
  
  <p>I don't know what that error message means... but I think (guess) it's because my msdia.dll is too old a version because I can dump the pdb's from older dll's that are at the 80's level; and I checked the dia.dll I installed and it's msdia80.dll, So -- I went and got msdia90.dll -- and I have now registered (regsvr32.exe msdia90.dll) and so I have installed both dia80.dll and dia90.dll.   However, the dia2dump only co-creates the dia80.dll at run time .... and even if I unregister it, but leave dia90 registered -- dia2dump will then complain it can't find the dll at all. ( CoCreateInstance failed - HRESULT = 80040154 )</p>
  
  <p>I'm not sure if this is because I am on a 32 bit machine, or because I am compiling under VS2008... or I registered the wrong dia90.dll somehow... or what?  How do I figure it out?</p>
  
  <p>This is what I've tried so far:</p>
  
  <p>I modified dia2dump.cpp to load the dll based on a the __uuid() of a forward reference to the class DiaSource; I hoped that the __uuid() would be able to find the active version of the class in the registry and supply the correct number, but VS2008 apparently doesn't work that way -- it computes the __uuidof() in some other fashion ... because even with diaguid.Lib deleted, and CLSID_DiaSource becoming undefined (I verified it can't find it.) using __uuidof(DiaSource) still caused it to find the CLSID for msdia80.dll -- not 90.</p>
  
  <pre><code>typedef class DiaSource;
  hr = CoCreateInstance(__uuidof(DiaSource),//CLSID_DiaSource, 
                          NULL, 
                          CLSCTX_INPROC_SERVER,
                          __uuidof(IDiaDataSource),
                          (void **) ppSource);
  </code></pre>
  
  <p>So, why is this not also linking to the CLSID for msdia90.dll ?
  I don't have the diaguid.Lib for version 90 -- just the dll.  But I do know, in the registry that there are two uuid's / CLSID's -- one for each version of the dll.</p>
  
  <p>HKEY_CLASSES_ROOT/CLSID/4C41678E-887B-4365-A09E-925D28DB33C2 # msdia90.dll 
  HKEY_CLASSES_ROOT/CLSID/BCE36434-2C24-499E-BF49-8BD99B0EEB68 # msdia80.dll</p>
  
  <p>Although, in the latest MSDN page at this time (2013), the name of the variable is still CLSID_DiaSource , suggesting the class is named the same in the new dll... So I don't know why there are two different CLSID's for the dll's...
  <a href="http://msdn.microsoft.com/en-us/library/hd8h6f46%28v=vs.120%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/hd8h6f46%28v=vs.120%29.aspx</a></p>
  
  <p>EDIT:
  I got it to link (CoCreate), I think, by doing this trick as a work-around, but the original error still happens when I run it with version 90 -- so my guess was wrong...</p>
  
  <pre><code>class __declspec(uuid("4C41678E-887B-4365-A09E-925D28DB33C2")) msdia90; 
  hr = CoCreateInstance(__uuidof( msdia90 ), 
  </code></pre>
  
  <p>So, I'm totally lost.  Why cant dia2dump.exe work on a downloaded mfc90.pdb file?</p>