国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
COM調(diào)用過程

Yes, it basically makes no sense to me that VB6 doesn't look up the registry keys.  It just doesn't.  COM object creation is usually done like this (simplified):

  1. From the "friendly name" of the coclass (COM object), obtain the CLSID from the registry.  Example:  Scripting.Dictionary is the friendly name and it maps to CLSID {EE09B103-97E0-11CF-978F-00A02463E06F} (see HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Scripting.Dictionary\CLSID).
  2. Using that CLSID, CoCreateInstance() is called.  Internally this does the lookup of the COM server binary in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID.  In our example, HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{EE09B103-97E0-11CF-978F-00A02463E06F}\InprocServer32 with a value of C:\Windows\system32\scrrun.dll.
  3. LoadLibrary() is used to load the dll and then the entry point forDllGetClassObject() is obtained.
  4. DllGetClassObject() is called using the CLSID desired.  This returns anIClassFactory pointer that is ultimately used to create the desired object.

All this should be happening in both .Net and VB6.  I see no other way around it.  In your case, theIClassFactory is returning 0x80040111 if the loaded DLL doesn't supply the COM object that corresponds to the given CLSID; and you get 0x80040111 probably from step 2 from the call toCoCreateInstance() when it doesn't find the desired CLSID under HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID.


-------------

1. I guess the next thing to do would be the tough job of debugging the class factory code.

 

2. To do this, you need to start debugging your COM DLL and set the C# client app as the startup application.

2.1 Via project properties, set the debugger type to "Mixed" so that you can see the C# client code.

2.2 Then place a breakpoint in your global DllGetClassObject() function. This function was generated by the ATL wizard for your DLL. It should look something like the following :

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
    return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
}

2.3 Start debugging. Note well that if you are able to reach the DllGetClassObject() function, it is clear that your COM DLL has been registered correctly. If you are not able to even reach DllGetClassObject(), something has gone wrong and we may be back to registration problems again.

2.4 If you do reach DllGetClassObject(), step through all the way until you reach the AtlComModuleGetClassObject() function (this is the ATL source code from my machine which uses VS2008) :

ATLINLINE ATLAPI AtlComModuleGetClassObject(_ATL_COM_MODULE* pComModule, REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
 if (ppv == NULL)
  return E_POINTER;
 *ppv = NULL;

 ATLASSERT(pComModule != NULL);
 if (pComModule == NULL)
  return E_INVALIDARG;
 if (pComModule->cbSize == 0)  // Module hasn't been initialized
  return E_UNEXPECTED;

 HRESULT hr = S_OK;

 for (_ATL_OBJMAP_ENTRY** ppEntry = pComModule->m_ppAutoObjMapFirst; ppEntry < pComModule->m_ppAutoObjMapLast; ppEntry++)
 {
  if (*ppEntry != NULL)
  {
   _ATL_OBJMAP_ENTRY* pEntry = *ppEntry;
   if ((pEntry->pfnGetClassObject != NULL) && InlineIsEqualGUID(rclsid, *pEntry->pclsid))
   {
    if (pEntry->pCF == NULL)
    {
     CComCritSecLock<CComCriticalSection> lock(pComModule->m_csObjMap, false);
     hr = lock.Lock();
     if (FAILED(hr))
     {
      ATLTRACE(atlTraceCOM, 0, _T("ERROR : Unable to lock critical section in AtlComModuleGetClassObject\n"));
      ATLASSERT(0);
      break;
     }
     if (pEntry->pCF == NULL)
      hr = pEntry->pfnGetClassObject(pEntry->pfnCreateInstance, __uuidof(IUnknown), (LPVOID*)&pEntry->pCF);
    }
    if (pEntry->pCF != NULL)
     hr = pEntry->pCF->QueryInterface(riid, ppv);
    break;
   }
  }
 }

 if (*ppv == NULL && hr == S_OK)
  hr = CLASS_E_CLASSNOTAVAILABLE;
 return hr;
}

Note the highlighted error code CLASS_E_CLASSNOTAVAILABLE. This error code has value0x80040111. Step through and see in what situation will this error code be returned.

2.5 Best of luck, Jicky.

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
ATL開發(fā)COM實(shí)現(xiàn)類廠和組件的創(chuàng)建框架調(diào)用過程
<font style="vertical-align: inherit;"><font style="vertical-align: inherit;">創(chuàng)建COM組件全過程(C ++)</font></font>
com技術(shù)內(nèi)幕
求大神指點(diǎn)迷津
用DirectShow開發(fā)自己的Filter
電腦操作中的一些經(jīng)典問答
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服