My program is a dll that hooks into a running instance of IE. It's worked fine for years.
我的程序是一个动态链接到IE运行实例的dll。它已经工作了很多年了。
Recently I dusted it off and ran it, but the last line below fails with hr = 0x80040154
:
最近我掸掉了它并运行它,但是下面最后一行的hr = 0x80040154失败了:
#import <mshtml.tlb> rename("value", "theValue") rename("event", "theEvent")
#import <shdocvw.dll>
// ....
SHDocVw::IShellWindowsPtr spSHWinds;
HRESULT hr = m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows));
Could it matter that IE7 has been replaced by IE8? Where else should I look?
IE7被IE8取代会有什么关系吗?我还应该到哪里去找呢?
I'm using VS2008, if that matters.
如果重要的话,我使用VS2008。
Edited to add
编辑添加
I don't see that it could be a 32/64 bit issue - it ran fine last year on this same machine. The only thing that's changed (as far as I have noticed) is the version of IE, from 7 to 8.
我不认为这可能是一个32/64位的问题——它去年在这台机器上运行良好。唯一改变的是IE的版本,从7到8。
Note to the bounty hunters:
赏金猎人注意事项:
I only have access to this system for a few hours a day (around 0:00 EST), so you may not get quick responses to your suggestions, but I will look into them.
我每天只能使用这个系统几个小时(美国东部时间0:00左右),所以你可能不会对你的建议做出快速的反应,但我会研究它们。
If you think there are things I should be checking (registry values, for example), be specific.
如果您认为我应该检查某些东西(例如,注册表值),请具体说明。
Edited to add:
编辑添加:
I now see that the first time I call CreateInstance, it returns 0x80070002, not 0x80040154.
我现在看到,第一次调用CreateInstance时,它返回0x80070002,而不是0x80040154。
1 个解决方案
#1
4
That's going to be very hard to diagnose. The ShellWindows coclass is special, its CLSID registry key is HKEY_CLASSES_ROOT\CLSID\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}
. When you look there, you'll see nothing useful registered there. The background story is that this is a leftover of an ill-fated attempt to make the Windows shell resemble a web browser. Still visible today, enumerating the shell windows returns both Windows Explorer and Internet Explorer instances.
这很难诊断。ShellWindows coclass是特殊的,它的CLSID注册表键是HKEY_CLASSES_ROOT\CLSID\{9ba05972 - f6a2 - 11cf - a442 - 00a0c90a8f39}。当你看那儿的时候,你会发现那里没有什么有用的东西。故事的背景是,这是一个注定要失败的尝试,使Windows shell类似于web浏览器。仍然可见,枚举shell windows同时返回windows Explorer和Internet Explorer实例。
The SysInternals' ProcMon utility is almost always the weapon of choice to debug 0x80040154 errors but it falls flat here. You can see it probing the registry, and not finding what it is looking for, but then the program knows how to load ieframe.dll anyway. This can only work by the operating system intercepting the CoCreateInstance() call. Which makes sense in general, considering the coclass enumerates shell windows.
SysInternals的ProcMon实用程序几乎总是调试0x80040154错误的首选工具,但在这里就不灵了。你可以看到它在搜索注册表,却找不到它在找什么,但是程序知道如何加载ieframe。dll。这只能通过操作系统拦截CoCreateInstance()调用来实现。考虑到coclass枚举shell窗口,这通常是有意义的。
All you got left is the trial-and-error approach. Reinstall IE first, OS next. Or to shove the machine out of a 4th story window before it eats too much of your valuable time.
剩下的就是试错法。先重新安装IE,然后再安装OS。或者把这台机器从四楼的窗户推出去,以免它占用你太多宝贵的时间。
#1
4
That's going to be very hard to diagnose. The ShellWindows coclass is special, its CLSID registry key is HKEY_CLASSES_ROOT\CLSID\{9BA05972-F6A8-11CF-A442-00A0C90A8F39}
. When you look there, you'll see nothing useful registered there. The background story is that this is a leftover of an ill-fated attempt to make the Windows shell resemble a web browser. Still visible today, enumerating the shell windows returns both Windows Explorer and Internet Explorer instances.
这很难诊断。ShellWindows coclass是特殊的,它的CLSID注册表键是HKEY_CLASSES_ROOT\CLSID\{9ba05972 - f6a2 - 11cf - a442 - 00a0c90a8f39}。当你看那儿的时候,你会发现那里没有什么有用的东西。故事的背景是,这是一个注定要失败的尝试,使Windows shell类似于web浏览器。仍然可见,枚举shell windows同时返回windows Explorer和Internet Explorer实例。
The SysInternals' ProcMon utility is almost always the weapon of choice to debug 0x80040154 errors but it falls flat here. You can see it probing the registry, and not finding what it is looking for, but then the program knows how to load ieframe.dll anyway. This can only work by the operating system intercepting the CoCreateInstance() call. Which makes sense in general, considering the coclass enumerates shell windows.
SysInternals的ProcMon实用程序几乎总是调试0x80040154错误的首选工具,但在这里就不灵了。你可以看到它在搜索注册表,却找不到它在找什么,但是程序知道如何加载ieframe。dll。这只能通过操作系统拦截CoCreateInstance()调用来实现。考虑到coclass枚举shell窗口,这通常是有意义的。
All you got left is the trial-and-error approach. Reinstall IE first, OS next. Or to shove the machine out of a 4th story window before it eats too much of your valuable time.
剩下的就是试错法。先重新安装IE,然后再安装OS。或者把这台机器从四楼的窗户推出去,以免它占用你太多宝贵的时间。