Re: How can LoadLibrary fail?
"David Webber" <dave@musical-dot-demon-dot-co.uk> wrote in message
news:%23ZjGSP7FIHA.3940@TK2MSFTNGP05.phx.gbl...
"Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote in message
news:epO$AaxFIHA.3548@TK2MSFTNGP06.phx.gbl...
You may want to use LoadLibraryEx with the LOAD_LIBRARY_AS_IMAGE_RESOURCE
flag, to avoid worrying about dependencies, platform match, etc.
Thanks Ben, that sounds very plausible. But the short answer is that it
won't do, as it is not supported until Vista.
You're right, LOAD_LIBRARY_AS_DATAFILE is the one I was intending to
recommend.
[snip]
I briefly considered LOAD_LIBRARY_AS_DATAFILE but
"Windows Me/98/95: You can use the resulting module handle only with
resource management functions such as EnumResourceLanguages,
EnumResourceNames, EnumResourceTypes, FindResource, FindResourceEx,
LoadResource, and SizeofResource. You cannot use this handle with
specialized resource management functions such as LoadBitmap, LoadCursor,
LoadIcon, LoadImage, and LoadMenu."
and I am still supporting win98 for the next year or so, I need these
functions, and so I rejected it.
That oughtn't to be a severe problem, you retrieve the resource data
yourself using LoadResource/SizeofResource and then call, for example,
CreateIconFromResource.
http://msdn2.microsoft.com/en-us/library/ms648060.aspx