dia2dump: CoCreateInstance failed - HRESULT = 80040154

匿名 (未验证) 提交于 2019-12-03 00:44:02

问题:

I'm trying to dump the signature of a PDB on Windows 7 x64 using Visual Studio 2017 and its dia2dump. I loaded C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\DIA2Dump.sln. It built successfully:

1>------ Rebuild All started: Project: Dia2Dump, Configuration: Debug x64 ------ 1>stdafx.cpp 1>regs.cpp 1>PrintSymbol.cpp 1>dia2dump.cpp 1>Generating Code... 1>Dia2Dump.vcxproj -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\x64\Debug\Dia2Dump.exe 1>Dia2Dump.vcxproj -> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\x64\Debug\Dia2Dump.pdb (Partial PDB) ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== 

When I run it on the PDB, I get the following error:

C:\>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\Samples\DIA2Dump\x64\Debug\Dia2Dump.exe" file.pdb CoCreateInstance failed - HRESULT = 80040154 

Just in case, I ran the following and it was successful, but dia2dump failed with the same error (also after reboot):

regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VC\msdia100.dll" 

How do I debug this?

回答1:

x64 Class not registered. you need run regsvr32 with x64 bit msdiaXXX.dll

RbMm posted the correct answer as comment already. But if someone faces the same problem: To register a 64-bit-DLL you need to use the regsvr32.exe from the C:/Windows/SYSWOW64 folder! Microsoft should have named it regsvr64.exe...



回答2:

I managed to get it to work by building Dia2Dump.exe as a 32-bit application. I did this in Visual Studio Community 2017 by opening the solution's project's properties, opened the Configuration Manage..., then changed the platform for the project to Win32.

I rebuilt the project, and now I no longer have CoCreateInstance failed - HRESULT = 80040154 errors! It works fine with any pdb file I give it.



回答3:

As of 20 June 2018, what I did was:

regsvr32 C:\Program Files\Common Files\Microsoft Shared\VC\msdia100.dll regsvr32 C:\Program Files\Common Files\Microsoft Shared\VC\msdia90.dll regsvr32 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\DIA SDK\bin\msdia140.dll 

Then I compiled as x64. It worked for me. If x64 didn't work, you can try x86.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!