<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why does GetDC fail? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693796#M175967</link>
    <description>&lt;P&gt;I found the answer and I do not like it at all. First, I found the actual intel reference to the function in gdi32.f90:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    FUNCTION MSFWIN$Rectangle( &amp;amp;
            arg1, &amp;amp;
            arg2, &amp;amp;
            arg3, &amp;amp;
            arg4, &amp;amp;
            arg5)
    use ifwinty
      integer(BOOL) :: MSFWIN$Rectangle ! BOOL
        !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'Rectangle' :: MSFWIN$Rectangle
      integer(HANDLE) arg1 ! HDC arg1
      integer(SINT) arg2 ! int arg2
      integer(SINT) arg3 ! int arg3
      integer(SINT) arg4 ! int arg4
      integer(SINT) arg5 ! int arg5
     END FUNCTION
    END INTERFACE&lt;/LI-CODE&gt;&lt;P&gt;But I could NOT use&lt;/P&gt;&lt;P&gt;Rectangle(hDC, ix1, iy1, ix2, iy2).&lt;/P&gt;&lt;P&gt;I had to use&lt;/P&gt;&lt;P&gt;MSFWIN$Rectangle(hDC, ix1, iy1, ix2, iy2).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it worked. I have absolutely NO idea why I could not use the alias (and so far the alias has worked fine everywhere else)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 01 Jun 2025 14:50:38 GMT</pubDate>
    <dc:creator>brianreinhold</dc:creator>
    <dc:date>2025-06-01T14:50:38Z</dc:date>
    <item>
      <title>Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693691#M175959</link>
      <description>&lt;P&gt;I have this simple routine to draw a solid color box in the client area of a window:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MODULE PboxModule

    CONTAINS    
        !&amp;gt; This subroutine draws a solid color box in a window.
        !&amp;gt; It uses the Win32 API to create a filled rectangle
        !&amp;gt; based on the provided coordinates and RGB color.
        !!
        !! &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/124536"&gt;@param&lt;/a&gt; IX1 Upper-left X-coordinate in window 
        !! &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/124536"&gt;@param&lt;/a&gt; IY1 Upper-left Y-coordinate in window 
        !! &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/124536"&gt;@param&lt;/a&gt; IX2 Lower-right X-coordinate in window 
        !! &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/124536"&gt;@param&lt;/a&gt; IY2 Lower-right Y-coordinate in window 
        !! &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/124536"&gt;@param&lt;/a&gt; color Packed RGB color value 
        !! &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/124536"&gt;@param&lt;/a&gt; hWnd Window handle
        SUBROUTINE PBOX(IX1, IY1, IX2, IY2, color, hWnd)
            USE IFWIN
            use user32
            use win32Interfaces
    
            IMPLICIT NONE

            ! Declare variables
            INTEGER, INTENT(IN) :: IX1, IY1, IX2, IY2
            INTEGER*4 :: color  ! RGB color value. Must be 32-bit
            INTEGER(HANDLE), INTENT(IN) :: hWnd
            INTEGER(HANDLE) :: hDC, hBrush
            INTEGER(BOOL) :: bret
            integer :: iret, err

            ! Get the device context for the window
            hDC = GetDC(hWnd)
            err = GetLastError()

            IF (hDC /= 0) THEN
                ! IC already represents an RGB color
                hBrush = CreateSolidBrush(color)

                ! Select the brush into the DC
                bret = SelectObject(hDC, hBrush)

                ! Draw the filled rectangle
                bret = Rectangle(hDC, IX1, IY1, IX2, IY2)

                ! Cleanup: release device context and delete brush
                iret = ReleaseDC(hWnd, hDC)
                iret = DeleteObject(hBrush)
            END IF
        END SUBROUTINE PBOX
end module PboxModule&lt;/LI-CODE&gt;&lt;P&gt;However, using the debugger I see the hDC = GetDC(hwnd) returns an absurd value, sometimes positive and sometime negative but in all cases very large. GetLastError() returns 0, but I don't know if that helps for these methods. The handle is valid.&lt;BR /&gt;&lt;BR /&gt;Any ideas what might be wrong?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 15:11:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693691#M175959</guid>
      <dc:creator>brianreinhold</dc:creator>
      <dc:date>2025-05-31T15:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693717#M175960</link>
      <description>&lt;P&gt;Fortran does not have unsigned integer type so when the high bit is set is show as a negative. The hDC is a memory address and will usually be a large number. Why do you think it is wrong? The info you have posted suggests all is good.&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 21:03:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693717#M175960</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-05-31T21:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693726#M175961</link>
      <description>&lt;P&gt;Because the box does not get drawn in the window. I pass in ix1, iy1 = 10, 10 and ix2, iy2 = 1000, 500 and RGB color red (255). Stepping through the debugger I see that the window handle is valid. I figured SOMETHING must be wrong because the window client area remains untouched after the call to Rectangle. I admit, looking at the responses it suggests that everything succeeded but I see nothing on the screen. Did I forget something stupid?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Intel advertises that it has win32 fortran examples&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sample SDI and MDI Fortran Windows Samples in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;WIN32&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder, such as Generic, Platform, or Angle.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot find them anywhere. Would you know where they are?&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2025 22:54:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693726#M175961</guid>
      <dc:creator>brianreinhold</dc:creator>
      <dc:date>2025-05-31T22:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693770#M175963</link>
      <description>&lt;P&gt;The old samples are well hidden and hard to find, I just happened to do that a few weeks back.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-Compiler-Information-and-Frequently-Asked/m-p/1329533#M158339" target="_blank" rel="noopener"&gt;https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-Fortran-Compiler-Information-and-Frequently-Asked/m-p/1329533#M158339&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On that page go to the Product Information&amp;nbsp; sections and there is a sample link that download a zip file.&lt;/P&gt;&lt;H2 id="toc-hId--677029650"&gt;&amp;nbsp;&lt;/H2&gt;</description>
      <pubDate>Sun, 01 Jun 2025 10:52:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693770#M175963</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-06-01T10:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693772#M175964</link>
      <description>&lt;P&gt;What are the returns of&amp;nbsp;&lt;SPAN&gt;CreateSolidBrush,&amp;nbsp;&amp;nbsp;SelectObject and&amp;nbsp;Rectangle? Does the window get a WM_PAINT in the message loop?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 11:01:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693772#M175964</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-06-01T11:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693782#M175965</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If this function is not called inside a WM_PAINT message I think you need at least a call to updatewindow to force a WM_PAINT to be sent, eventually preceded by a call to invalidaterect if necessary.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 12:07:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693782#M175965</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2025-06-01T12:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693795#M175966</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/66560"&gt;@andrew_4619&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/85284"&gt;@GVautier&lt;/a&gt;&amp;nbsp; Thanks you guys for helping out. I would have never found those samples. In any case, I have extended my application to error check everything, get the hDC, and get window from hDC. I have added a PEN (and since removed). In all cases everything works EXCEPT rectangle. It always fails with error 6. My updated code (just tons of error checks that print results to a list box in the main dialog) is posted below. However, what might be conflicting is what 'Rectangle' is declared as in the intel library.&lt;BR /&gt;&lt;BR /&gt;The only thing I found is&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    INTERFACE
    	FUNCTION RECTANGLE(CONTROL,X1,Y1,X2,Y2)
    !DEC$ ATTRIBUTES DEFAULT :: RECTANGLE
    	  INTEGER*2 RECTANGLE
    !DEC$ ATTRIBUTES DECORATE,C,ALIAS:"_rectangle" ::  RECTANGLE
    	  INTEGER*2 CONTROL,X1,Y1,X2,Y2
    	END FUNCTION
    END INTERFACE
    INTERFACE
    	FUNCTION RECTANGLE_W(CONTROL,WX1,WY1,WX2,WY2)
    !DEC$ ATTRIBUTES DEFAULT :: RECTANGLE_W
    	  INTEGER*2 RECTANGLE_W,CONTROL
    !DEC$ ATTRIBUTES DECORATE,C,ALIAS:"_rectangle_w" ::  RECTANGLE_W
    	  DOUBLE PRECISION WX1,WY1,WX2,WY2
    	END FUNCTION
    END INTERFACE
    INTERFACE&lt;/LI-CODE&gt;&lt;P&gt;in the file ifqwin.f90. It does NOT seem to be the same as the Rectangle win32 API used in C/C++.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here is my updated code (unchanged except for error checks)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        SUBROUTINE PBOX(IX1, IY1, IX2, IY2, color, hWnd, hLog)
            USE IFWIN
            use user32
            use gdi32
            use win32Interfaces
    
            IMPLICIT NONE

            ! Declare variables
            INTEGER, INTENT(IN) :: IX1, IY1, IX2, IY2
            INTEGER*4, intent(in) :: color  ! RGB color value. Must be 32-bit
            INTEGER(HANDLE), INTENT(IN) :: hWnd, hLog
            
            INTEGER(HANDLE) :: hDC, hBrush, hWndCheck
            INTEGER(BOOL) :: bret
            integer :: iret
            character(len=512) :: message
            type(T_LOGBRUSH) :: logBrush

            ! Get the device context for the window
            hDC = GetDC(hWnd)
            hWndCheck = WindowFromDC(hDC)
            if (hWndCheck == 0) THEN
                bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM("Obtained hDC is invalid:"C)))
                RETURN
            END IF
            IF (hDC /= 0) THEN
                write(message, '(A, I0)') 'hDC Value: ', hDC
                bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM(message)))
                
                ! color already represents an RGB color
                hBrush = CreateSolidBrush(color)
                !hBrush = GetStockObject(BLACK_BRUSH)
                if (hBrush == 0) THEN
                    bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM("Error Creating hBrush:"C)))
                ELSE
                    message = repeat('', len(message)) 
                    write(message, '(A, I0)') 'hBrush value: ', hBrush
                    bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM(message)// CHAR(0)))
                END IF
                
                ! Select the brush into the DC
                bret = SelectObject(hDC, hBrush)
                if (bret == 0) THEN
                    bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM("Error Selecting hBrush:"C)))
                END IF

                iret = GetObject(hBrush, sizeof(logBrush), LOC(logBrush))
                if (iret == 0) THEN
                    iret = ReleaseDC(hWnd, hDC)
                    bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM("Error getting object from hBrush:"C)))
                    RETURN
                END IF
                
                ! Draw the filled rectangle
                message = repeat('', len(message))
                write(message, '(A, I0, A, I0)') 'Drawing rectangle at: ', IX1, ', ', IY1
                bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM(message)// CHAR(0)))
                bret = Rectangle(hDC, IX1, IY1, IX2, IY2)
                if (bret == 0) THEN
                    iret = GetLastError()
                    message = repeat('', len(message))
                    write(message, '(A, I0)') 'Drawing rectangle failed with error: ', iret
                    bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM(message)// CHAR(0)))
                END IF

                ! Cleanup: release device context and delete brush
                iret = ReleaseDC(hWnd, hDC)
                iret = DeleteObject(hBrush)
            else
                bret = SendMessage(hLog, LB_ADDSTRING, 0, LOC(TRIM("Error getting device context:"C)))
            END IF
        END SUBROUTINE PBOX

end module PboxModule&lt;/LI-CODE&gt;&lt;P&gt;Running it shows that everything works EXCEPT for Rectangle. Window handles are valid (test window is WS_OVERLAPPEDWINDOW), the hDC and hBrush are valid.&amp;nbsp; The error message '6' invalid handle may be very misleading if Rectangle is calling the interface specified above.&lt;BR /&gt;&lt;BR /&gt;By the way, why don't I get an email notification when someone responds here? I have checked that option but it does not happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 14:15:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693795#M175966</guid>
      <dc:creator>brianreinhold</dc:creator>
      <dc:date>2025-06-01T14:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693796#M175967</link>
      <description>&lt;P&gt;I found the answer and I do not like it at all. First, I found the actual intel reference to the function in gdi32.f90:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    FUNCTION MSFWIN$Rectangle( &amp;amp;
            arg1, &amp;amp;
            arg2, &amp;amp;
            arg3, &amp;amp;
            arg4, &amp;amp;
            arg5)
    use ifwinty
      integer(BOOL) :: MSFWIN$Rectangle ! BOOL
        !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'Rectangle' :: MSFWIN$Rectangle
      integer(HANDLE) arg1 ! HDC arg1
      integer(SINT) arg2 ! int arg2
      integer(SINT) arg3 ! int arg3
      integer(SINT) arg4 ! int arg4
      integer(SINT) arg5 ! int arg5
     END FUNCTION
    END INTERFACE&lt;/LI-CODE&gt;&lt;P&gt;But I could NOT use&lt;/P&gt;&lt;P&gt;Rectangle(hDC, ix1, iy1, ix2, iy2).&lt;/P&gt;&lt;P&gt;I had to use&lt;/P&gt;&lt;P&gt;MSFWIN$Rectangle(hDC, ix1, iy1, ix2, iy2).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it worked. I have absolutely NO idea why I could not use the alias (and so far the alias has worked fine everywhere else)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 14:50:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693796#M175967</guid>
      <dc:creator>brianreinhold</dc:creator>
      <dc:date>2025-06-01T14:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693799#M175968</link>
      <description>&lt;P&gt;I think you have most of the answer I read your earlier post and was about to give you what you have found. In the history Intel supported migration from Microsoft Fortran which ceased in the early 90s, the Microsoft product has a load of graphics routines which later conflicted with the names of windows sdk routines. There is/was am IFWIN module that aliases the names. BTW IFWIN includes GDI32 and USER32 you shout not need to USE those directly&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 15:43:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693799#M175968</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-06-01T15:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693801#M175969</link>
      <description>&lt;P&gt;IFQWIN has a "rectangle"&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;   INTERFACE
    	FUNCTION RECTANGLE(CONTROL,X1,Y1,X2,Y2)
    !DEC$ ATTRIBUTES DEFAULT :: RECTANGLE
    	  INTEGER*2 RECTANGLE
    !DEC$ ATTRIBUTES DECORATE,C,ALIAS:"_rectangle" ::  RECTANGLE
    	  INTEGER*2 CONTROL,X1,Y1,X2,Y2
    	END FUNCTION
    END INTERFACE&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 01 Jun 2025 15:52:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693801#M175969</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-06-01T15:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693803#M175970</link>
      <description>&lt;P&gt;Here &lt;A href="https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-0/rectangle-rectangle-w.html" target="_blank"&gt;https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2025-0/rectangle-rectangle-w.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;It's a quickwin function.This kind of problem is hard to solve.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 16:10:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693803#M175970</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2025-06-01T16:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693815#M175971</link>
      <description>&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-rectangle" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-rectangle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;BOOL Rectangle(
  [in] HDC hdc,
  [in] int left,
  [in] int top,
  [in] int right,
  [in] int bottom
);&lt;/LI-CODE&gt;&lt;P&gt;That is the SDK version which is what&amp;nbsp; you wanted, you would need to add your own interface. Noting the "int" is a 4 byte integer. the interface below is 32 and 64 bit and would work with ifort/ifx/gfortran&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;interface ! Recatangle
    function Rectangle( hdc, left, top,right, bottom) BIND(C,NAME="Rectangle")
        import
        integer(BOOL) :: Rectangle ! BOOL
        !DIR$ ATTRIBUTES STDCALL :: Rectangle
        !GCC$ ATTRIBUTES STDCALL :: Rectangle
        integer(HANDLE), value ::  hdc ! HDC arg1
        integer(SINT), value ::left, top,right, bottom  
    end function
end interface&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Jun 2025 20:59:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1693815#M175971</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-06-01T20:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1694338#M175978</link>
      <description>&lt;P&gt;In the end I am just going with the prefixed version of the method. As it turns out I need to use the prefixed version of many methods in gdi32. As long as I know and have it written in the code comments.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 12:48:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1694338#M175978</guid>
      <dc:creator>brianreinhold</dc:creator>
      <dc:date>2025-06-03T12:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why does GetDC fail?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1694359#M175981</link>
      <description>If you are doing that I personally would make a wapper functions e.g. my_rectangle that calls the msfwin and make a module with them all in. That way if you change compiler you only have that module to fix.</description>
      <pubDate>Tue, 03 Jun 2025 14:26:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Why-does-GetDC-fail/m-p/1694359#M175981</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2025-06-03T14:26:48Z</dc:date>
    </item>
  </channel>
</rss>

