Subject: | Problem with tk_getopenfile and Win32::OLE::Const |
Date: | Mon, 13 Dec 2010 09:58:40 -0800 (PST) |
To: | bug-Win32-OLE [...] rt.cpan.org |
From: | gary sachs <conversecorollary [...] yahoo.com> |
Dear Sir or Madam,
I am encountering an issue with tk_getopenfile when Win32::OLE::Const is present in the file even though it may be in a subroutine. I am using ActiveState PERL 5.12 on a WINDOWS XP SP3 box. When the Win32::OLE::Const is present the Tk_getopenfile does not reload properly when choosing a different file type from the pull down file type box. The code will demonstrate the issue or at least it did on my box.
The code below should work properly...
use 5.010;
use strict;
use warnings;
use Tkx;
use strict ;
use Win32::OLE;
#use Win32::OLE::Const 'Microsoft Office.* Object Library';
#use Win32::OLE::Const 'Microsoft Word';
use Win32::Process ; # Launch a Windows program
my $types = [ ['CSV files', ['.csv']],
['ZIP files', ['.zip']],
['ALL files', ['*']],
];
my $filelist = Tkx::tk___getOpenFile(-multiple => 1, -title => "Open a CSV File",
-defaultextension => '.csv',
-initialfile => '*.csv',
-filetypes => $types,
-initialdir => 'c:\temp',
);
Tkx::MainLoop();
exit;
But if I uncomment one of the lines containing Win32::OLE::Const as in the next example the reloads to not occur properly when choosing a different file type...
use 5.010;
use strict;
use warnings;
use Tkx;
use strict ;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Office.* Object Library';
#use Win32::OLE::Const 'Microsoft Word';
use Win32::Process ; # Launch a Windows program
my $types = [ ['CSV files', ['.csv']],
['ZIP files', ['.zip']],
['ALL files', ['*']],
];
my $filelist = Tkx::tk___getOpenFile(-multiple => 1, -title => "Open a CSV File",
-defaultextension => '.csv',
-initialfile => '*.csv',
-filetypes => $types,
-initialdir => 'c:\temp',
);
Tkx::MainLoop();
exit;
I look forward to hearing from you.
Thank you,
gary