This example loads the WndProc procedure, returning a pointer to the procedure, from the RES.DLL library, based on the library handle returned by WinLoadLibrary.
#define INCL_WINLOAD /* Window Load Functions */ #include <os2.h> PFNWP pWndproc; /* procedure pointer */ HAB hab; /* anchor-block handle */ HLIB hlib; /* library handle */ char pszLibname[10]="RES.DLL"; /* library name string */ char pszProcname[10]="WndProc"; /* procedure name string */ /* load RES.DLL */ hlib = WinLoadLibrary(hab, pszLibname); /* load WndProc */ pWndproc = WinLoadProcedure(hab, hlib, pszProcname);