- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In coding for a gui application (not qwin) I've run into a slight problem with compiling a subroutine.
1>------ Build started: Project: Pearson, Configuration: Debug x64 ------
1>Compiling with Intel(R) Visual Fortran Compiler 16.0 [Intel(R) 64]...
1>DoGrids.f90
1>C:\Users\Brooks\Desktop\Projects\Pearson\Pearson\DoGrids.f90(26): error #6413: This global name is invalid in this context. [SETWINDOWORG]
1>C:\Users\Brooks\Desktop\Projects\Pearson\Pearson\DoGrids.f90(37): error #6413: This global name is invalid in this context. [SETWINDOWEX]
1>C:\Users\Brooks\Desktop\Projects\Pearson\Pearson\DoGrids.f90(48): error #6413: This global name is invalid in this context. [SETVIEWPORTEX]
1>compilation aborted for C:\Users\Brooks\Desktop\Projects\Pearson\Pearson\DoGrids.f90 (code 1)
These three routines are needed. There is no use that I've found so I created 3 interfaces that I designed using msdn as a guide. They are:
interface
function SetWindowOrg(hdc, x, y, pt)
use ifwinty
integer(BOOL),intent(out):: SetWindowOrg
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetWindowOrg' :: SetWindowOrg
integer(HANDLE),Intent(in):: hdc
integer(4),Intent(in):: x, y
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pt
type(T_POINT),Intent(out):: pt
end function setWindowOrg
end interface
interface
function SetWindowEx(hdc, x, y, pt)
use ifwinty
integer(BOOL),intent(out):: SetWindowEx
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetWindowEx' :: SetWindowEx
integer(HANDLE),Intent(in):: hdc
integer(4),Intent(in):: x, y
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pt
type(T_POINT),Intent(out):: pt
end function setWindowEx
end interface
interface
function SetViewportEx(hdc, x, y, pt)
use ifwinty
integer(BOOL),intent(out):: SetViewportEx
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'SetViewportEx' :: SetViewportEx
integer(HANDLE),Intent(in):: hdc
integer(4),Intent(in):: x, y
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: pt
type(T_POINT),Intent(out):: pt
end function SetViewportEx
end interface
So I don't understand the error messages. I've tried compiling without the interfaces and still problems!
Sincerely,
Brooks Van Horn
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can't use INTENT on the function result. Just declare the function names with the type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
OK that gets it past the compile stage but I now get 3 external references on those functions that are unknown.
Brooks
1>ipo: error #11023: Not all components required for linking are present on command line
1>ipo_6969278obj3.obj : error LNK2019: unresolved external symbol SetWindowEx referenced in function DOGRIDS
1>ipo_6969278obj3.obj : error LNK2019: unresolved external symbol SetViewportEx referenced in function DOGRIDS
1>ipo_6969278obj3.obj : error LNK2019: unresolved external symbol SetWindowOrg referenced in function DOGRIDS
1>x64\Debug\Pearson.exe : fatal error LNK1120: 3 unresolved externals
1>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to MSDN these should be in gdi32.lib. So why would MSVS 2013 not pick it up?
Brooks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Win32 does not have the SetWindowOrg API - that was for Win16 only. The API you want is SetWindowOrgEx.
Similarly you may have been looking for SetViewportOrgEx for one of the other API's.
ifort provides interfaces to those API's in the GDI32 module.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page