Wednesday 15 January 2014

c++ - How do I free SQLServerCE's COM instance from the current running process? -


It's been great if I touched COM;) This is under Windows CE 5.0 5.0 SQLServerCE 2.0.

After calling it to load SQLServerCE 2.0: -

  Start IDBI * pIDBInitialize = NULL; CoCreateInstance (CLSID_SQLSERVERCE_2_0, NULL, CLSCTX_INPROC_SERVER, IID_ID initiation, (zero **) and pIDBInitialize);  

The module load is for SSCE20.dll which clearly loads the SQLServerCE engine in the process space.

I do not understand what I do immediately after this: -

  pIDBInitialize-> Release ();  

I do not see the Dell module unload, so SSCE20.dll (and friends) will still load in my process.

Now I have tried CoFreeUnusedLibraries (), which I emphasize COM to clean any unused libraries, but this does not seem to be a trick.

At the runtime I completely unblock 3.5SP1 with the process to fully upgrade SQLServerCE 2.0 dll.

I suspect that this is something with the shared DLL model that Microsoft uses under WindowsCE ... but, I may be wrong :)

Thanks in advance, < / P>

David

I think that CoFreeUnusedLibraries was hidden in later versions of Windows (XP and Forward, if I remember right) is this, it does nothing.

Specifies an unreasonable delay while calling the function, to minimize the risk that a thread has attempted to create an instance concurrently to unload a DLL.

It may be that they were not happy with the delay (I think it still presents a possible race situation), and decided to completely remove the functionality.

You CoUninitialize and see if it loads an unload.


No comments:

Post a Comment