- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried to run a Qwin program (built with CVF6.6b) for the first time in a PC running Windows XP, and when clicking in the "open file" menuitem, the open file dialog doesn't shows and my program's message for clicking "cancel" in the open filedialog appears. The program uses GETOPENFILENAME.
This never happened in lots PCs with W98, W98SE and ME.
I installed VFRUN66BI but problem persists.
Thanks for any help
Regards,
Geraldo
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may need to copy DLL's on which it is dependant. Try this link and others referenced by it http://softwareforums.intel.com/ids/board/message?board.id=5&message.id=8645&highlight=redistributable#M8645
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This won't have anything to do with DLLs as a QuickWin app is always statically linked. It's possible that you have some other software on the system that is interfering with common dialog boxes. Someone else mentioned Adobe Acrobat 7 as a culprit in some issues.
It would be useful to step through the code that calls GetOpenFileName and see what the return value is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for answering,
I discovered what was causing the problem, but not why.
I had:
GGG%LPSTRFILE = LOC(NOMEARQUIVO)
GGG%NMAXFILE = LEN(NOMEARQUIVO)
GGG%NMAXFILE = LEN(NOMEARQUIVO)
NOMEARQUIVOis declared in a module.
I changed to
CHARACTER*255 NOM
etc...
GGG%LPSTRFILE = LOC(NOM)
GGG%NMAXFILE = LEN(NOM)
GGG%NMAXFILE = LEN(NOM)
etc...
RET = GETOPENFILENAME(GGG)
NOMEARQUIVO=NOM ! I have to use NOMEARQUIVO elseware
NOMEARQUIVO=NOM ! I have to use NOMEARQUIVO elseware
etc...
Those are the only changes I have made. Program settings were not changed.
The programnow runsok in XP (and also in W98SE)
I wonder why the old way worked in W98SE and not in XP.
Regards
Geraldo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you NUL-terminate the string?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After CHARACTER*255 NOM
NOM is first used in
GGG%LPSTRFILE = LOC(NOM)
GGG%NMAXFILE = LEN(NOM)
GGG%NMAXFILE = LEN(NOM)
So I supose itwas not Nul-terminated.
Originaly it was like that::
IF(NOMEARQUIVO.NE.' ') THEN
CLOSE(2)! file previously opened
NOMEARQUIVO=' ' ! "clear" the stringfrom previous file name
END IF
FILTER(1) = 'Arquivos EST 'C
FILTER(2) = '*.est'C
FILTER(3) = ''C
DLGTITLE = 'Abrir Estao'C
CLOSE(2)! file previously opened
NOMEARQUIVO=' ' ! "clear" the stringfrom previous file name
END IF
FILTER(1) = 'Arquivos EST 'C
FILTER(2) = '*.est'C
FILTER(3) = ''C
DLGTITLE = 'Abrir Estao'C
etc...
Using NOMEARQUIVO=' 'C, instead of NOMEARQUIVO=' ' would it work?
Geraldo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would have to see the entire code to understand what it is doing. But I can tell you that all strings passed to GetOpenFileName must be NUL-terminated and the strings it returns are also NUL-terminated. Also, output strings are written only as far as the terminating NUL and any remaining characters in the buffer are not modified, so that could confuse Fortran comparisons if you look at the whole CHARACTER variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the original code(modification needed to run on XPin comments):
subroutinegetfilename
use dflib
use modan303
use dfwin
use dflib
use modan303
use dfwin
type (t_openfilename)ggg
logical(kind=4)ret,retlog
character(len=26)filter(3)
character(len=60)dlgtitle
!character*255 nom ! to run on XP !
external lerdados
logical(kind=4)ret,retlog
character(len=26)filter(3)
character(len=60)dlgtitle
!character*255 nom ! to run on XP !
external lerdados
if(nomearq.ne.' ') then
close(2)
nomearq=''
end if
filter(1) = 'arquivos est 'c
filter(2) = '*.est'c
filter(3) = ''c
dlgtitle = 'Abrir Estao'c
ggg%lstructsize = (bit_size(ggg%lstructsize) + &
bit_size(ggg%hwndowner) + &
bit_size(ggg%hinstance) + &
bit_size(ggg%lpstrfilter) + &
bit_size(ggg%lpstrcustomfilter) + &
bit_size(ggg%nmaxcustfilter) + &
bit_size(ggg%nfilterindex) + &
bit_size(ggg%lpstrfile) + &
bit_size(ggg%nmaxfile) + &
bit_size(ggg%lpstrfiletitle) + &
bit_size(ggg%nmaxfiletitle) + &
bit_size(ggg%lpstrinitialdir) + &
bit_size(ggg%lpstrtitle) + &
bit_size(ggg%flags) + &
bit_size(ggg%nfileoffset) + &
bit_size(ggg%nfileextension) + &
bit_size(ggg%lpstrdefext) + &
bit_size(ggg%lcustdata) + &
bit_size(ggg%lpfnhook) + &
bit_size(ggg%lptemplatename))/8
ggg%hwndowner = null
ggg%hinstance = null
ggg%lpstrfilter = loc(filter(1))
ggg%lpstrcustomfilter = null
ggg%nmaxcustfilter = null
ggg%nfilterindex = 1
ggg%lpstrfile = loc(nomearq) ! ggg%lpstrfile = loc(nom) ! for XP !
ggg%nmaxfile = len(nomearq) ! ggg%nmaxfile = len(nom)! for XP!
ggg%lpstrfiletitle = null
ggg%nmaxfiletitle = null
ggg%lpstrinitialdir = loc('c:proj'c)
ggg%lpstrtitle = loc(dlgtitle)
ggg%flags = null
ggg%nfileoffset = null
ggg%nfileextension = null
ggg%lpstrdefext = null
ggg%lcustdata = null
ggg%lpfnhook = null
ggg%lptemplatename = null
nomearq=''
end if
filter(1) = 'arquivos est 'c
filter(2) = '*.est'c
filter(3) = ''c
dlgtitle = 'Abrir Estao'c
ggg%lstructsize = (bit_size(ggg%lstructsize) + &
bit_size(ggg%hwndowner) + &
bit_size(ggg%hinstance) + &
bit_size(ggg%lpstrfilter) + &
bit_size(ggg%lpstrcustomfilter) + &
bit_size(ggg%nmaxcustfilter) + &
bit_size(ggg%nfilterindex) + &
bit_size(ggg%lpstrfile) + &
bit_size(ggg%nmaxfile) + &
bit_size(ggg%lpstrfiletitle) + &
bit_size(ggg%nmaxfiletitle) + &
bit_size(ggg%lpstrinitialdir) + &
bit_size(ggg%lpstrtitle) + &
bit_size(ggg%flags) + &
bit_size(ggg%nfileoffset) + &
bit_size(ggg%nfileextension) + &
bit_size(ggg%lpstrdefext) + &
bit_size(ggg%lcustdata) + &
bit_size(ggg%lpfnhook) + &
bit_size(ggg%lptemplatename))/8
ggg%hwndowner = null
ggg%hinstance = null
ggg%lpstrfilter = loc(filter(1))
ggg%lpstrcustomfilter = null
ggg%nmaxcustfilter = null
ggg%nfilterindex = 1
ggg%lpstrfile = loc(nomearq) ! ggg%lpstrfile = loc(nom) ! for XP !
ggg%nmaxfile = len(nomearq) ! ggg%nmaxfile = len(nom)! for XP!
ggg%lpstrfiletitle = null
ggg%nmaxfiletitle = null
ggg%lpstrinitialdir = loc('c:proj'c)
ggg%lpstrtitle = loc(dlgtitle)
ggg%flags = null
ggg%nfileoffset = null
ggg%nfileextension = null
ggg%lpstrdefext = null
ggg%lcustdata = null
ggg%lpfnhook = null
ggg%lptemplatename = null
ret = getopenfilename(ggg)
if(.not.ret) then
iret = messagebox (null, "No foi feita escolha de arquivo"c,"Ateno"c,&
mb_iconexclamation+mb_ok+mb_taskmodal)
retlog=modifymenuflagsqq (2, 0, $menugrayed)
else
!nomearq=nom !(nomearq needed in lerdados were it is openedand data is read)
call lerdados
end if
end subroutine getfilename
Nomearq is declared in modan303.
The program in runing in XP. To tell the true, in most of the tries :sometimes the graphic is not ploted;I will check this issuewhenchangingto XP in thePCs the program runs onwill be a need, and then perhaps I will call for help.
Geraldo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the declaration of Nomearq? Could it be that it's too short for the full path on the XP system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep, make sure NOMEARQ is big enough...
character($maxpath) NOMEARQ
(However, if this were the case ...to quote from the Help for GETOPENFILENAME..
"If the buffer is too small, the function returns FALSE and the CommDlgExtendedError function returns FNERR_BUFFERTOOSMALL. In this case, the first two bytes of the lpstrFile buffer contain the required size, in bytes or characters. "
..and save youself some code by using
GGG%structsize=SIZEOF(GGG)
Message Edited by anthonyrichards on 07-24-2005 04:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
NOMEARQ is declared in a module as:
character*255 NOMEARQ
In the original code (the one not working in XP) I used AnthonyRichards suggestions (thanks). Compiled without problems but failed to run on XP (but ran on W98SE).Implementing the modifications that are commented in the code above, andalso using the suggestions, it ran on XP. So it seems the size of NOMEARQ is not the culprit.
Geraldo

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