From: Morbus I. <mo...@di...> - 2001-06-28 15:47:51
|
I'm getting hard crashes when I use a registry check against the default browser. The program will request the default browser (in this case, Opera), open the browser correctly, and display the page. Mozilla/Netscape/IE work fine, but in the case of Opera, I get a infinitely repeatable crash as soon as the page is done loading. I've traced the bug to something within the Windows registry. A description and workaround is below. a) Downloaded Opera 5.12 for Windows. b) Opened it up, set it as the default browser. That was the only configuration change. c) Ran my program using the following code: use Win32::API; my $ShellExecute = new Win32::API("shell32", "ShellExecuteA", ['N','P', 'P', 'P', 'P', 'I'], 'N'); $ShellExecute->Call(0, "open", $url, 0, 0, 1); d) Opera opened up, displayed the main page, and program crashes. Ok. Hmf. c) Ran my program using the following code: system("c:\progra~1\opera\opera.exe $url"); Opera opened up, displayed the main page, and birds sing. The question is: why? And is there a workaround? Does the $ShellExecute call return the path to the browser? Can I do something like: use Win32::API; my $ShellExecute = new Win32::API("shell32", "ShellExecuteA", ['N','P', 'P', 'P', 'P', 'I'], 'N'); # pseudo code below if ($ShellExecute->Path =~ /Opera/i) { system("$ShellExecute->Path $url"); } else { $ShellExecute->Call(0, "open", $url, 0, 0, 1); } Is something like that possible? -- Morbus Iff ( .sig on other machine. ) http://www.disobey.com/ && http://www.gamegrene.com/ "where's there's a will, there's a morbus ready to collect!" |
From: Johan L. <jo...@ba...> - 2001-06-28 16:33:44
|
Morbus wrote: > system("c:\progra~1\opera\opera.exe $url"); Does this do what you want? system("start $url"); Even system("$url"); should work. This all assumes that $url contains a file with a file extension which is mapped to an application on your system. But .html files should work in, like, 99.23 percent of all cases. And if someone screwed up their system, let that remain their problem :) /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |