[fpc-devel] Problem loading 2 dlls created on Free Pascal

Marco van de Voort marcov at stack.nl
Thu Jul 13 09:11:05 CEST 2006


> var
>   Lib, Lib2: HINST;
> begin
>   Lib := LoadLibrary('C:\Programas\Apache\pmodules\newlib.dll');
>   Lib2 := LoadLibrary('C:\Programas\Apache\pmodules\newlib2.dll');
>   WriteLn(Lib);
>   WriteLn(Lib2);
>   Sleep(5000);
>   FreeLibrary(Lib);
>   FreeLibrary(Lib2);
> end.
> 
> The WriteLn statements show that the first library is loaded
> successfully. The second will return zero.
> 
> If the second library being loaded is not created with Free Pascal (I
> tested with libhttpd.dll). The load will be successfull.

You might get a clue if you print last windows error.
(sysutils.getlastoserror) after the 2nd loadlib



More information about the fpc-devel mailing list