[fpc-pascal]Linking to Windows

Hans MÃ¥rtensson hm at os.dk
Wed Feb 5 16:21:49 CET 2003


At 02:00 05-02-2003 +0100, you wrote:
>please post the 'uses' clauses and the function declaration from your
source. 
>that should make it easier.
>
>anton.
>
Here is a test program I have used:

program x_prog;
{$APPTYPE GUI}
uses windows;
var pPrinter: LPHANDLE;
    prd: PRINTER_DEFAULTS;
Procedure OpenPrinter(pPintername: LPSTR; phPrinter: LPHANDLE; pDefault:
PRINTER_DEFAULTS); external;
begin
  OpenPrinter('HP-printer', pPrinter, prd);
end.

This gives linking error during compilation because it has not been defined
what to link with. A NAME can be added after the word 'external', but then
I need to know the name of the DLL that includes the OpenPrinter function.

Hans M.




More information about the fpc-pascal mailing list