I am using Strawberry Perl (v5.16.3) built for MSWin32-x86-multi-thread and win32::GUI on a Microsoft Windows 7 system. I am using Eclipse/EPIC to write and test the code. I am trying to display a picture / bitmap / Icon / Cursor. Have tried all 3, results the same nothing is returned from win32::gui::LoadImage. I have added some print lines to gui.PM for debugging and I have a test script to test for this gui function. Since the code for win32::gui::LoadImage subroutine is not in the GUI.PM module, is it being included from the C library or windows? Does there need to be changes to the code calling win32::gui::LoadImage? In advance thanks for the help Bob

## print lines added to gui.PM for debugging ########## ## (Lines are Suffixed with comment #Bob) ############# package Win32::GUI::Bitmap; @ISA = qw(Win32::GUI); end; sub new { my $class = shift; my $self = {}; my $inputa =shift @_; #Bob print "Len=" . length($inputa)."\n"; #Bob # my $handle = Win32::GUI::LoadImage(@_); #Bob commented out the + origional my $handle = Win32::GUI::LoadImage($inputa, 0, 0, 0, 0); #Bob print "Gui.PM(Win32::GUI::_new) self='$self' input='@_' inputa='$i +nputa' \n ";# Bob print "Gui.PM handle=".$handle." ".$self."\n"; #Bob # TODO: this gives us a bitmap object, even if we ask for a cursor +! #### test script ################################################# +### use Win32::GUI(); our $Window = Win32::GUI::Window->new( -name => "Window", -top => 120, -left => 120, -height => 300, -width => 300 ); our $Icon=""; $Icon = Win32::GUI::Bitmap->new("eclipse16.gif") ;#or die $^E; + print "Test Icon=".$Icon."\n"; # See if Bitmap return anything our $Button = $Window -> AddButton( -name => "Icon", -text => "Icon", -top => 50, -left => 50, -height => 100, -width => 100, -picture => $Icon, -icon => $Icon, -bitmap => $Icon, # add this line here, try if works ); # $Window->$Button-> $Bitmap ; $Window->SetIcon($Icon); $Window->Show(); Win32::GUI::Dialog(); sub Window_Terminate { return -1; }

In reply to nothing returned from win32::gui::LoadImage by hcs-kis.rte

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.