Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

From steve )at( petabit.com

Dear all: I'm running Win32:FileOp for the first time, trying to use the OpenDialog function. Relative newbie as far as perl on windows goes, I'm pretty comfortable on Unix.

Everytime I call FileOp::OpenDialog, Perl crashes to Dr. Watson! Since I'm new at this and there's no mention on the net of known bugs in this module, I assume I'm doing something dumb. Here's the snippet (Running on NT)

  sub OpenFile_Click {
      $FileName= Win32::FileOp::OpenDialog(

#	title => "Open Text File",
#	defaultfilter => 1
	);
	# print ("Want me to open $Filename ?\n");
      exit(0);
   }


P.S. I see the Dr. whether those parameters are enabled or not.

P.P.S. The event handler is dada's Win32::GUI

Replies are listed 'Best First'.
RE: Win32:FileOp Crashes Perl
by retrosteve (Initiate) on Nov 05, 2000 at 22:48 UTC
    This is steve )at( petabit.com again, with a status report on my question.

    First, thanks little, it looks like the syntax of the hash indexes isnt the problem though.

    Thanks to saint jcwren for trying it out himself and determining that it works fine on ActiveState Perl 5.22, even with my parameters!

    I am assuming for now that my problem is ActiveState Perl v5.6.0, or with Win32::FileOp Followups welcome.

    Initiate Retrosteve.
Re: Win32:FileOp Crashes Perl
by the_slycer (Chaplain) on Nov 06, 2000 at 00:34 UTC
    I have had this problem fairly infrequently using different modules on win32. One of the things that will ALWAYS cause this is a binary that was compiled against a different version of perl. If you can, grab the source of the module and compile on your machine, see if that does the trick. If this is not an option, try and find a more up to date version of the module.

    HTH
      Thanks for the idea, slycer, but I don't get it. I just looked through all the modules I'm using and they all seem to be source (text) only, no binaries at all. I don't even know what perl module binaries would look like. Am I missing something?
Re: Win32:FileOp Crashes Perl
by little (Curate) on Nov 05, 2000 at 21:28 UTC
    dunno that module, but when passing the arguments what about:
    sub OpenFile_Click { $FileName= Win32::FileOp::OpenDialog( 'title' => 'Open Text File', 'defaultfilter' => '1' ); # print ("Want me to open $Filename ?\n"); exit(0); }

    Well at least this is how CGI.pm likes parameters to get passed :-)

    Have a nice day
    All decision is left to your taste