Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When you need an in-proc COM object, you don't link directly to the implementing DLL. You usually use <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms686615%28v=vs.85%29.aspx" rel="nofollow"><code>CoCreateInstance</code></a>/<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms680701%28v=vs.85%29.aspx" rel="nofollow"><code>CoCreateInstanceEx</code></a>, which will load the DLL for you.</p> <p>The lookup goes through the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa374191%28v=vs.85%29.aspx" rel="nofollow">application's manifest</a> and its dependant <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa374219%28v=vs.85%29.aspx" rel="nofollow">assembly manifests</a>. This is done to support <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa375134%28v=vs.85%29.aspx" rel="nofollow">registration-free COM</a>.</p> <p>If there's no application manifest or if none of the dependant assembly manifests declare your class in a <code>comClass</code> XML element, the lookup defaults to the registry, which will check <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms691424%28v=vs.85%29.aspx" rel="nofollow"><code>HKEY_CLASSES_ROOT\CLSID</code></a><sup>1</sup> for a subkey named <code>{&lt;your-CLSID&gt;}</code>, itself with an <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682390%28v=vs.85%29.aspx" rel="nofollow"><code>InProcServer32</code></a> subkey stating the DLL.</p> <p>This explains why SomeCOMlib.dll doesn't appear as a dependency. It doesn't explain why LibA.dll doesn't appear as a dependency of it, probably because it's dynamically loaded. If you profile your app within Dependency Walker, you'll see a log of LoadLibrary calls in the bottom pane. To profile it, open your Python executable in Dependency Walker, then go to menu option Profile->Start profiling..., set the parameters to run your <code>.py</code> file and click Ok.</p> <p>The 0xE06D7363 exception code is a <a href="http://support.microsoft.com/kb/185294" rel="nofollow">Visual C++ exception code</a>. You should check the source code of <code>doSomethingWithCOMobj</code>. To debug it, use your preferred tool (Visual C++, WinDbg, etc.), open Python's executable, setting up the arguments to run your <code>.py</code> file, and enable a breakpoint on the first statement of the function before running the application. Then run it and step through each instruction.</p> <p>It's really hard to guess what's different about your native C++ application and Python, but it may be that different COM initialization arguments are used by Python and <code>doSomethingWithCOMobj</code>, or that you haven't declared it <code>__stdcall</code> (although being a void function that shouldn't matter), or that it tries to write to stdout and you're using <code>pythonw.exe</code> which isn't a console application, etc.</p> <hr> <p><sup>1.</sup> <code>HKEY_CLASSES_ROOT</code> is a mix of <code>HKEY_CURRENT_USER\Software\Classes</code> and <code>HKEY_LOCAL_MACHINE\Software\Classes</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload