Bart
2011-01-02 23:34:55 UTC
Hi,
I want something unusual.
I need to dynamically (as opposed to statically) load some functions
from a windows dll.
Normally this is not such a big problem using
Handle := LoadLibrary('some.dll')
and
FunctionAddress := GetProcAddres(Handle, Name)
However the functions I need are only exported by index, not by name,
so no luck with GetProcAddres().
A static example that _won't_ work:
function CharUpperBuffWrapW(lpsz:LPWSTR; cchLength:DWORD):DWORD;
stdcall; external 'shlwapi.dll' name 'CharUpperBuffWrapW';
A static example that _will_ work:
function CharUpperBuffWrapW(lpsz:LPWSTR; cchLength:DWORD):DWORD;
stdcall; external 'shlwapi.dll' index 44;
(MS info on shlwapi.dll also only provides indexes)
Does anyone have a suggestion how to load these functions dynamically?
Bart
I want something unusual.
I need to dynamically (as opposed to statically) load some functions
from a windows dll.
Normally this is not such a big problem using
Handle := LoadLibrary('some.dll')
and
FunctionAddress := GetProcAddres(Handle, Name)
However the functions I need are only exported by index, not by name,
so no luck with GetProcAddres().
A static example that _won't_ work:
function CharUpperBuffWrapW(lpsz:LPWSTR; cchLength:DWORD):DWORD;
stdcall; external 'shlwapi.dll' name 'CharUpperBuffWrapW';
A static example that _will_ work:
function CharUpperBuffWrapW(lpsz:LPWSTR; cchLength:DWORD):DWORD;
stdcall; external 'shlwapi.dll' index 44;
(MS info on shlwapi.dll also only provides indexes)
Does anyone have a suggestion how to load these functions dynamically?
Bart
--
Bart Broersma
***@tiscali.nl
(ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)
Bart Broersma
***@tiscali.nl
(ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)