Inline ***
Willy.
> Hi Willy,
> Thanks fo your reply.
> I understood your reply. But didn't get any solution to my problem.
>
> My DLL is a native C++ dll, which is created (using CoCreateInstance)
> by
*** And here CoCreateInstance will call LoadLibrary, not CoLoadLibrary, IMO,
this loaded DLL will not be unloaded when you call CoFreeUnusedLibraries.
> another COM component configured with COM+. So my C++ component is running
> under DLLHOST process & DLLHOST will have a Handle to the DLL. As my C++
[quoted text clipped - 9 lines]
> HANDLE reference (not same as the HANDLE to the DLL created during
> CoCreateInstance of the C++ component) been added to the DLLHOST process.
*** Which file does this HANDLE belongs to?
> Once i am done with debugging i am Detaching the C++ component from the
> DLLHOST process. Now i am unloading the C++ component by using
> CoFreeUnUsedLibraries() to RELOAD my C++ component with some changes.
> CoFreeUnUsedLibraries freeeing the HANDLE created during the
> CoCreateInstance, but still the FILE HANDLE created by DLLHOST during the
> Attach process exists,
*** Again try to find-out which file this handle belongs to.
because of this when i try to modify the C++
> component by recompiling, it gives error stating that the it cannot
> override the dll, as the FILE HANDLE reference is held by the DLLHOST.
>
> If i release the FILE HANDLE reference explicitly using process explorer i
*** so if you release the handle to this "mysterious" file, you can
overwrite your dll? Seems like this is the handle of your DLL.
> am able to compile my program. As DLLHOST is not releasing the FILE HANDLE
> reference i feel it could be problem with .NET.
*** Sorry but I'm missing the relation with .NET, your components are
unmanaged C++ dll's.
> Please suggest me some solution.
*** Why not stop the COM+ application before you overwrite a DLL?
> Regards,
> Ramesh
Ramesh K - 14 Apr 2004 14:38 GMT
Replies are inline &&&
> Inline ***
>
[quoted text clipped - 8 lines]
> *** And here CoCreateInstance will call LoadLibrary, not CoLoadLibrary, IMO,
> this loaded DLL will not be unloaded when you call CoFreeUnusedLibraries.
&&&Forgot to mention that we are freeing the Pointer to the object and
then calling CoFreeUnUsedLibraries()..Dll getting released at this point
..able to observer this in Process Explorer.
> > another COM component configured with COM+. So my C++ component is running
> > under DLLHOST process & DLLHOST will have a Handle to the DLL. As my C++
[quoted text clipped - 11 lines]
> >
> *** Which file does this HANDLE belongs to?
&&& Our C++ Component, which i am debugging by Attahcing to DLLHOST
Process. During Attach to DLLHOST this FILE HANDLE been added to the
DLLHOST. I also found other System dll's which are Attached during the
Attach to DLLHOST.
> > Once i am done with debugging i am Detaching the C++ component from the
> > DLLHOST process. Now i am unloading the C++ component by using
[quoted text clipped - 3 lines]
> > Attach process exists,
> *** Again try to find-out which file this handle belongs to.
&&&Pretty sure that My C++ Component FILE HANLDE alongwith the other System
DLL's.
> because of this when i try to modify the C++
> > component by recompiling, it gives error stating that the it cannot
[quoted text clipped - 4 lines]
> *** so if you release the handle to this "mysterious" file, you can
> overwrite your dll? Seems like this is the handle of your DLL.
&&& Yes,this is the FILE HANDLE reference of my C++ component. Also this is
not the HANDLE TO THE DLL.
> > am able to compile my program. As DLLHOST is not releasing the FILE HANDLE
> > reference i feel it could be problem with .NET.
> >
> *** Sorry but I'm missing the relation with .NET, your components are
> unmanaged C++ dll's.
&&& relation is DLLHOST holds the FILE reference During Attach ..which is
not getting released during Detach from the DLLHOST..
> > Please suggest me some solution.
> >
> *** Why not stop the COM+ application before you overwrite a DLL?
&&&I can't, as my COM+ application hosts other DLL's which should be alive
throughout my application life cycle..Only the exception is my C++ component
loads & unloads during the application life cycle.
> > Regards,
> > Ramesh