Silverfrost Forums

Welcome to our forums

GetDC etc

15 Apr 2019 1:04 #23498

I'm racking my brains for an answer to this one. Recompiling and linking a rather long program not recompiled since 2015 causes FTN95 to declare the routines GetDC and GetDeviceCaps missing at link time (WARNING The following symbols are missing), and if the resulting EXE is run, it fails with a missing_GetDC@4.

Rather oddly, if I make up a demonstrator:

        OPTIONS (INTL)
        PROGRAM DC
        INCLUDE <WINDOWS.INS>
        iHDC  = GetDc (0)         ! Monitor / Windows system
        ixdpi = GetDeviceCaps (iHDC, LOGPIXELSX)
        iydpi = GetDeviceCaps (iHDC, LOGPIXELSY)
        WRITE(*,*) iHDC, ixdpi, iydpi
        END

then it all works fine. I've checked in the long program that the INCLUDE is there, and indeed, the demonstrator is simply lines copied from the big program.

Using 32 bit and 8.40PE (also tried 8.30PE).

Any ideas that I could try?

Eddie

15 Apr 2019 2:07 #23499

Eddie

See if you can get a clue from a linker MAP file. The interfaces are

      STDCALL GETDC 'GetDC' (VAL):INTEGER(7)
      STDCALL GETDEVICECAPS 'GetDeviceCaps' (VAL,VAL):INTEGER*4

so you will be looking for GETDC and GetDC etc.

15 Apr 2019 2:34 #23500

Hi Paul,

Tried that and it reported GetDeviceCaps missing. Recompiled files where GetDeviceCaps is mentioned: same problem. Recompiled everything (I've done that before, more than once, just in case the issue is files compiled with a previous version), relinked - and problem gone.

Bizarre.

I'd forgotten /MAP, but it is useful.

Thanks

Edded

Please login to reply.