Search
Active

1
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 507480
Opened: 11/2/2009 2:20:04 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
The Perl/Tk functions getOpenFile() and getSaveFile() (dialog boxes to select a file to open or save) do not work under Windows 7. It was tested e.g. with Windows 7 Enterprise. A perl program terminates immediately and without any warnings/errors when any of the functions getOpenFile() or getSaveFile() is being called.

The both Perl/Tk functions getOpenFile() and getSaveFile() do work well under Windows 2000, XP and Vista. Is there any workaround for the old Common File Dialog (CFD) interface of Perl/Tk in order that these dialog functions using the Microsoft CFD library will also run under Windows 7 ?

I have read somewhere on a Microsoft Support site:
>> It is very important to note that the APIs for using the legacy CFD have not changed since
>> Windows Vista, and XP to support application compatibility under Win7.
This is not apparently right! The problem looks like a new bug or compatibility problem of the CFD API in Windows 7.

Here is an ActivePerl snippet that worked fine in all older Windows versions (2000, XP, Vista e.g.):

#!./perl -w

use Tk;

my $file1;
my $types = [
['My Files', '.dat'],
['All Files', '*' ],
];
my $mw = new MainWindow;

### The methods getOpenFile and getSaveFile pop up a dialog box for the user to select a file to open or save.
### If the user selects a file, both getOpenFile and getSaveFile return the full pathname of this file.
### If the user cancels the operation, both commands return an undefined value.

$file1 = $mw->getOpenFile(-title => "Select a file to READ", -defaultextension => '.dat', -filetypes=>$types );
print "File selected by getOpenFile(): $file1 \n";

$file1 = $mw->getSaveFile(-title => "Select a file to WRITE", -defaultextension => '.dat');
print "File selected by getSaveFile(): $file1 \n";

Tk::MainLoop();
Details (expand)
What is your OneCare version?
(To check your build version; open Windows Live OneCare, in the upper right click Help, then select About Windows Live OneCare... Your version will be listed near the top).
I don't know or other
Operating System
Windows Server
Bug Type
Other
SubType
Other
How often does this happen?
Always Happens
Have you seen this problem before in this product?
No, this is new to the most recent version
Reproduction Steps
1. Install ActivePerl from ActiveState.
2. Run the submitted perl code (snippet).
Expected Results
Normally, without error (on Vista, XP, 2000), a file select dialog box will appear. Under Windows 7, the perl script terminates without any errors or warnings.
File Attachments
0 attachments
Sign in to post a comment.