问题描述
我正在尝试通过CoCreateInstance使用MFC DLL,但遇到了问题.
我有
I''m trying to use an MFC DLL using CoCreateInstance but I''m having problems.
I have
<br />
CLSID clsid;<br />
HRESULT hr;<br />
IInterface* pIInterface;<br />
CLSIDFromString(L"My.ID", &clsid);<br />
hr = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IInterface, (LPVOID*)&pIInterface);<br />
正确获取了CLSID(我已经检查过了),但是CoCreateInstance返回了E_OUTOFMEMORY.
我已经阅读了尽可能多的内容,但是对于CoCreateInstance来说,返回E_OUTOFMEMORY看起来是非常不寻常的.
我觉得这个错误并不是真正要告诉我的错误.我认为还有其他问题,但这是什么?我如何找到?非常感谢任何帮助.
The CLSID is obtained correctly (I have checked this), but CoCreateInstance returns with E_OUTOFMEMORY.
I''ve read around as much as I can, but it looks like it''s very unusual for CoCreateInstance to return with E_OUTOFMEMORY.
I have a feeling this error isn''t what it''s really trying to tell me. I think something else is the matter, but what is it? How do I find out? Any help greatly appreciated.
推荐答案
这篇关于来自CoCreateInstance的E_OUTOFMEMORY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!