Screensaver Issues - Kernel32.DLL Error



My Screensaver can be installed (by Install option when right-clicked on the
file with Explorer) and run correctly for the first time while being in
Display Properties Window. I can run it here (Dialog and Preview working) as
many times as I want. But when I click Apply and return back to Display
Properties, it crashes under WinME with Kernel32.DLL error (though it won`t
crash under XP). It doesn`t even start my application because very first line
of WinMain is creation of LOG.TXT and it if would crash inside my
application, the error message would state that it`s inside. Just to be sure,
I put try-catch handler into WinMain but it doesn`t even get to WinMain.
What`s even more weird is, that the screensaver runs itself after specified
time (alwyas in XP, less often in WinME where it crashes).
However, WinXP doesn`t show this Kernel32.DLL error when being for second
time in Display Properties. It just does nothing (but at leat it won`t craash
under XP).

I tried it on 3 machines but it`s always the same problem regardless of
DirectX version used (debug/retail 8.1 or 9.0b-c). I always need to select
"Install" option in Explorer to make "Configure" and "Preview" buttons in
"Display Properties" work.

Please Advise
.


Loading