- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
implicit none
integer :: hwnd
Generic procedure reference has two or more specific procedure with the same type/rank/keyword signature. [FINDWINDOW]
Can anybody tell me why? I'm using IVF10.0.26 and VS2003.
Thanks Jiri
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jiri,
The best way to go about solving these problems for yourself is to search the IVF include directory for the interface declarations. In user32.f90 (the module that creates user32.mod) you will find the declaration for FindWindow. To-wit:
INTERFACE FindWindow
FUNCTION FindWindow_G1( &
lpClassName, &
lpWindowName)
use ifwinty
integer(HANDLE) :: FindWindow_G1 ! HWND
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'FindWindowA' :: FindWindow_G1
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpClassName
character*(*) lpClassName ! LPCSTR lpClassName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpWindowName
character*(*) lpWindowName ! LPCSTR lpWindowName
END FUNCTION
FUNCTION FindWindow_G2( &
lpClassName, &
lpWindowName)
use ifwinty
integer(HANDLE) :: FindWindow_G2 ! HWND
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'FindWindowA' :: FindWindow_G2
integer(LPVOID) lpClassName ! LPCSTR lpClassName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpWindowName
character*(*) lpWindowName ! LPCSTR lpWindowName
END FUNCTION
END INTERFACE
The 2nd template is the one you are attempting to call. When using the interfaces you will find that FORTRAN compilers do not promote variables with the same viggor as does C++.
I think you may find that if you change your code to
integer(HANDLE) :: hwnd
If that fails then also add/change
integer(LPVOID) :: myNULL
hwnd = findwindow(myNULL, title)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should not use FindWindow_G1 in your code. Unfortunately, there is an error in the declaration in the module that makes the generic reference ambiguous. I'll have that fixed in a future release. You can keep using the _G1 name for now, though I will agree that GetForegroundWindow() is a better choice.
I don't underatand your second question. If this is a console application, the console window should appear immediately even without any output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo Steve
Regaring my second question. There was a little misunderstanding. You are right. Console appears immediately after runing exe file. But after this when I try to open dialog "Save as" the placing of this dialog depends on whether there was any output to console before opening this dialog. If there was any output dialog "Save as" appears behind the console.If there wasn't any output dialog "Save as" appears in front the console.
Sorry for my English.
Jiri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From Vista:
Console appears, no dialog, and Ctr C ing gives
forrtl: severe (24):end-of-file during read, unit -4, file CONIN$
etc
Doesn't matter whether 'run as admin' or in 'xp compatibility'.
However, the ivf sample runs just fine on 2-click :console behind dialog.
In vs 2005, run without debug: no go
In vs 2005 debug: runs fine
Gerry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting Vista results...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By 'no go' (slang)I meanit doesn't happen or work. What does happen is the console appears, stuff is written to it, and then it disappears,all in the blink of an eye.
Gerry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, it seems to behave as I would expect. With the exe you posted earlier all I did was 2-click it. Since that didn't do muchI went to the ivf samples folder and rebuilt the project in vs in both debug and release mode. Debugging both (yes, the debugger snivels about the absence of debug symbols but no matter) displayed the open dialog on top of the console. Ditto on 2-clicking the exes from explorer. Running the release in vs from debug/run without debugging behaved like the exe you posted earlier. Is this what is odd? It must be the weather or ...
Gerry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I ran your exe (also under Windows XP)
The console appeared, I entered a number, then the File Open dialog appeared. No problems here.
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ditto on Vista, provided you enter a number when the console appears. However the source in the ivf samples folder doesn't expect keyboard input to kick start the app. Has something changed in the source for the posted exe over that generated by rebuilding the ivf samples source?
Gerry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page