Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
but i want to replace the true directory "c:/test/pic.jpg" with a variable such as:# Hosting WebBrowser # use Cwd; use Win32::GUI; use Win32::OLE; use Win32::GUI::AxWindow; my $desk = Win32::GUI::GetDesktopWindow(); my $dw = Win32::GUI::Width($desk); my $dh = Win32::GUI::Height($desk); my $dir = getcwd; # main Window $Window = new Win32::GUI::Window ( -title => "Win32::GUI::AxWindow and Win32::OLE", -pos => [0, 0], -size => [$dw, $dh], -name => "Window", ) or die "new Window"; # Create AxWindow $Control = new Win32::GUI::AxWindow ( -parent => $Window, -name => "Control", -pos => [0, 0], -size => [$dw, $dh], -control => "Shell.Explorer.2", ) or die "new Control"; #my $filejpg = $dir . '/' . 'pic.jpg'; # Get Ole object $OLEControl = $Control->GetOLE(); $OLEControl->Navigate("about:Blank"); # Clear control $OLEControl->{Document}->write('<html><body><img src = "c:/test/pic.jp +g" /></body></html>'); # Write Html # Event loop $Window->Show(); Win32::GUI::Dialog(); # Main window event handler sub Window_Terminate { # Release all before destroy window undef $OLEControl; $Control->Release(); return -1; } sub Window_Resize { if (defined $Window) { ($width, $height) = ($Window->GetClientRect)[2..3]; $Control->Resize ($width, $height); } }
it does not work for me using a variable while it is working using a "c:/test/pic.jpg" , what is the solution. i am using activestate perl 5.10 windows xp$OLEControl->{Document}->write('<html><body><img src = "$file" /></bod +y></html>'); # Write Html
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: can't replace a directory with a variable
by psini (Deacon) on Jul 01, 2008 at 14:35 UTC | |
|
Re: can't replace a directory with a variable
by NetWallah (Canon) on Jul 01, 2008 at 14:39 UTC | |
|
Re: can't replace a directory with a variable
by rovf (Priest) on Jul 02, 2008 at 07:09 UTC |