On Thu, 01 Sep 2005, Zorg, the Borg wrote:
> 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
> .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?

Please call

    Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE);

*before* you instantiate any Win32::OLE objects.  This should fix the problem
with the Windows Common Dialogs.  Since you are writing a program with a message
loop there should be no bad side effects of running in apartment threading mode.

Cheers,
-Jan


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to