Re: Postmaster service code

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Postmaster service code
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE17167E@algol.sollentuna.se
обсуждение исходный текст
Ответ на Postmaster service code  ("Dave Page" <dpage@vale-housing.co.uk>)
Список pgsql-hackers-win32
> I have a question to be able to finish DllRegisterServer
> function. The function must write full pathname of dll in
> registry. In a classical Windows setup program, this path is
> chosen by end-user at runtime.
> We discuss a few week (month ?) ago to store the path in
> registry too and create env variable for backward
> compatibility with existent programs.
>
> Did you remember what was the final decision ?

I think your best bet is to use GetModuleFileNameEx() and friends
(probably need to EnumProcessModules(), I can't remember if there is a
direct API call to give you the current DLL. Or you can save away the
HMODULE value in DllMain() in a global variable - that might be easier)
to find out the exact path of the DLL that regsvr32 is invoked on, and
write that path to the registry.

That way you are completely independent of where the DLL is installed,
as long as it's not moved. (And not being able to move a program/dll
after it has been installed is pretty normal)


//Magnus


В списке pgsql-hackers-win32 по дате отправления:

Предыдущее
От:
Дата:
Сообщение: ssl on win32
Следующее
От: "Slava Ilijin"
Дата:
Сообщение: Info