I've used GetModuleFileName() to verify that the first parameter of
DllMain() is alright: GetModuleFileName() returns the correct filename.
Anyone with an idea why DisableThreadLibraryCalls() could fail? I'm using
VC++ 2008 SP1 on Vista Business SP2.
Boris
The documentation gives two possible reasons for failure, at most one of
which you eliminated:
"The DisableThreadLibraryCalls function fails if the DLL specified by
hModule has active static thread local storage, or if hModule is an invalid
module handle"
There is a newsgroup post that seems to suggest that ERROR_MOD_NOT_FOUND is
indicative of a failure due to TLS.
Disable Thread Library Calls:
http://msdn.microsoft.com/en-us/library/ms682579(VS.85).aspx
BOOST Library:
http://groups.google.com/group/comp.programming.threads/browse_thread/thread/e2071a348b238d93/9ca269fd54a472a
Paul
"Boris Schaeling" <bo...@highscore.de> wrote in message
news:op.uxfl0xcmhcamje@bose...
From the docum:
"The DisableThreadLibraryCalls function fails if the DLL specified by
hModule has active static thread local storage"
--pa
> It is common courtesy to research your problem by reading the
> documentation
> and using a search engine to look for similar posts.
>
> The documentation gives two possible reasons for failure, at most one of
> which you eliminated:
> "The DisableThreadLibraryCalls function fails if the DLL specified by
> hModule has active static thread local storage, or if hModule is an
> invalid
> module handle"
Who would expect that the error message "The specified module could not be
found" means that thread-local storage is used? Eliminating reasons for
failure is creative but wouldn't increase my trust in code. Answers like
yours in Usenet do help though. So thanks to you and Pavel!
Boris
I am not sure what trust has to do with it? The function did what it was
documented to do. If you expect a function always to do what *you* want it
to do, you will often be disappointed. And if you write code without reading
the documentation, you will get unexpected behaviour.
Now there are at least *two* posts about this syndicated all over the
Internet, so the next person will find it even easier to get the answer on
their own :)
Paul
"Boris Schaeling" <bo...@highscore.de> wrote in message
news:op.uxfpxpyjhcamje@bose...