P
Polanski24
Hello!
I have developed a managed BHO and band objects which work almost OK.
One of two problems I currently face is that they are always loaded
into
explorer.exe processs when folder browser window is open (they are not
loaded at initial explorer.exe startup at the user session start).
IObjectWithSite.SetSite implementation is used for checking if process
the controls are in is explorer.exe and if yes the COMException with
HRESULT E_FAIL is thrown. This prevents controls from being activated
but as assemblies are once loaded into process they stay in there until
process ends. .NET band object is not a lightweight component and it
should be prevented from being loaded as useless memory garbage.
My understanding is that explorer loads data into deafult AppDoamin
which
just stays there until process terminates. I have tried to call
AppDomain.Unload(AppDomain.CurrentDomain) but with no success - as
expected. This is obviously a bad solution as any other managed BHOs or
band objects would be unloaded in case of success as well.
Long reasearch pointed me into the direction of unmanaged solution
which uses DllMain return value to prevent loading - false is returned
when module is loaded into explorer.exe process.
Any ideas how can I accomplish selective loading from managed code
only?
Cheers
I have developed a managed BHO and band objects which work almost OK.
One of two problems I currently face is that they are always loaded
into
explorer.exe processs when folder browser window is open (they are not
loaded at initial explorer.exe startup at the user session start).
IObjectWithSite.SetSite implementation is used for checking if process
the controls are in is explorer.exe and if yes the COMException with
HRESULT E_FAIL is thrown. This prevents controls from being activated
but as assemblies are once loaded into process they stay in there until
process ends. .NET band object is not a lightweight component and it
should be prevented from being loaded as useless memory garbage.
My understanding is that explorer loads data into deafult AppDoamin
which
just stays there until process terminates. I have tried to call
AppDomain.Unload(AppDomain.CurrentDomain) but with no success - as
expected. This is obviously a bad solution as any other managed BHOs or
band objects would be unloaded in case of success as well.
Long reasearch pointed me into the direction of unmanaged solution
which uses DllMain return value to prevent loading - false is returned
when module is loaded into explorer.exe process.
Any ideas how can I accomplish selective loading from managed code
only?
Cheers