Newsgroups: comp.windows.ms.programmer
Path: utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau
From: bonneau@hyper.hyper.com (Paul Bonneau)
Subject: Re: GetProcAddress() in a DLL
Message-ID: <1991May22.200845.29598@hyper.hyper.com>
Keywords: win3 DLL SetWindowsHook
Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,)
Organization: HyperCube Inc.
References: <1991May15.133642.40@mgc.uucp> <glenn.674521319@imagen> <1991May21.205525.10557@dbase.A-T.COM>
Date: Wed, 22 May 1991 20:08:45 GMT

In article <1991May21.205525.10557@dbase.A-T.COM>
jamesc@dbase.UUCP (James Chuang ) writes:
>Hello world:
>I'm trying to use SetWindowsHook() in a DLL.  I've been trying to use
>GetProcAddress() to get the address of the callback function.  No luck.
>It always returns 0 for the address, which is pretty useless.  I have
>made sure of the following:
>	callback function is exported in the DLL's .def file
>	the name is correct, I have tried all variations there...
>
>I've even tried to explicitly load the library with LoadLibrary, then
>use the library handle to call GetProcAddress().  All I get there is a UAE.
>I've also tried using the ordinal numbers defined in the .def, no luck there.
>
>How can it be done.....?
>
The only thing I can think of to look out for is that the
code segment containing the hook function must be fixed (see
page 20.2.3 of the "Guide to Programming".

cheers - Paul Bonneau.
