Z
zorg.borg
Hi all,
i'm experiencing some strange problems when using the module Win32::OLE
together with windows dialogs.
In the following code snippet, I use an opendialog to pick a file. The
dialog works as expected: when a different file type is selected in the
combobox, the file listing changes accordingly.
However, if I uncomment the two Win32::OLE lines, the behaviour
changes: if
I pick any file type the file list becomes empty, not even showing
folders. The only way to have some file names displayed is typing
something like '*.*' in the file name box and then clicking 'Open'.
I first experienced this problem using Tk's getopenfile. I switched to
Win32::FileOp as I was thinking it was a Tk problem (as it had other
problem, like the handling od unicode file names).
I'm using activestate perl 810, Win32::FileOp 0.14.1.0 and Win32::OLE
0.1702.0.0, both from http://www.bribes.org/perl/, and I get the same
results under win98, win2000 and winxp sp2.
anyone experiencing the same thing? any suggestions?
thanks,
davide
[code snippet follows]
use strict;
use warnings;
#use Win32::OLE;
#my $EXC = Win32::OLE->GetActiveObject('Excel.Application');
use Win32::FileOp;
use File::Slurp;
my %parameters = (
title => 'test',
filters => [ 'log files' => '*.log;*.txt',
'Files .log' => '*.log',
'Files .txt' => '*.txt',
'All files' => '*.*'],
defaultfilter => 1,
dir => 'c:\\',
options => (OFN_HIDEREADONLY, OFN_OVERWRITEPROMPT),
);
my $file = OpenDialog %parameters;
exit unless ($file);
print "you picked $file\n";
my $contents=read_file($file);
print "----------------\n$contents\n--------------\n";
i'm experiencing some strange problems when using the module Win32::OLE
together with windows dialogs.
In the following code snippet, I use an opendialog to pick a file. The
dialog works as expected: when a different file type is selected in the
combobox, the file listing changes accordingly.
However, if I uncomment the two Win32::OLE lines, the behaviour
changes: if
I pick any file type the file list becomes empty, not even showing
folders. The only way to have some file names displayed is typing
something like '*.*' in the file name box and then clicking 'Open'.
I first experienced this problem using Tk's getopenfile. I switched to
Win32::FileOp as I was thinking it was a Tk problem (as it had other
problem, like the handling od unicode file names).
I'm using activestate perl 810, Win32::FileOp 0.14.1.0 and Win32::OLE
0.1702.0.0, both from http://www.bribes.org/perl/, and I get the same
results under win98, win2000 and winxp sp2.
anyone experiencing the same thing? any suggestions?
thanks,
davide
[code snippet follows]
use strict;
use warnings;
#use Win32::OLE;
#my $EXC = Win32::OLE->GetActiveObject('Excel.Application');
use Win32::FileOp;
use File::Slurp;
my %parameters = (
title => 'test',
filters => [ 'log files' => '*.log;*.txt',
'Files .log' => '*.log',
'Files .txt' => '*.txt',
'All files' => '*.*'],
defaultfilter => 1,
dir => 'c:\\',
options => (OFN_HIDEREADONLY, OFN_OVERWRITEPROMPT),
);
my $file = OpenDialog %parameters;
exit unless ($file);
print "you picked $file\n";
my $contents=read_file($file);
print "----------------\n$contents\n--------------\n";