Title: TabStrips, OFN and Out of memory! - Callback Called Exit.

I'm not sure what is going on, but...

When I click on a subroutine that Opens the Determine_File_Name routine (below), everything looks good for the first 2 of 3 tabstrips... 

The third tabstrip has ~10 checkboxes (3 of which are checked by default), whereas the first 2 Tabstrips only have 1 checkbox (unchecked).

Upon selecting the 3rd Tabstrip item and running the Determine_File_Name sub, I get:

You cancelled.
Out of Memory!
Callback Called Exit.

(And the script dies and dumps me at the command prompt.)

If anyone has ideas, I'd appreciate the feedback.

AS522 GUI 434 NT4EE SP5

Here's the code.

sub Determine_File_Name {
  $ret = GUI::GetOpenFileName(
    -title  => "$CFG{'Constants'}{'GuiName'} Export File",
    -file   => "\0" . " " x 256,
    -filter => [
        "Text documents (*.txt)"         => "*.txt",
        "Comma Seperated Values (*.csv)" => "*.csv",
        "All files"                      => "*.*",
    ],
  );
  if($ret) {
    print "Returned: '$ret'\n";
  } else {
    if(GUI::CommDlgExtendedError()) {
      print "ERROR. CommDlgExtendedError is: ", GUI::CommDlgExtendedError(), "\n";   
    } else {
      print "You cancelled.\n";
    }
  }
}


########
#Here's the creation of the Window, Menu and Checkboxes.
########
#Excerpt from CFG Hash
%CFG = ( 'ExportWindowCheckboxes'
                        => {'Computers'   => {'Windows for Workgroups Workstations'  => '',
                                              'Windows 95/98 Workstations'           => '',
                                              'Windows NT Workstations'              => '',
                                              'Windows NT Servers'                   => '1',
                                              'Windows NT SQL Servers'               => '',
                                              'Windows NT Primary Domain Controller' => '1',
                                              'Windows NT Backup Domain Controllers' => '1',
                                              'Novell/NDS Servers'                   => '',
                                              'Unix/Samba Servers'                   => '',
                                             },                       
                             'Groups'     => {'IncludeGroups' => '',
                                             },
                             'Users'      => {'IncludeUsers'  => '',
                                            },

       );

  $ExportMenu = Win32::GUI::MakeMenu(
      "&File"                          => "File",
      "   > Create File"               => "Export_File_Create_From_Selected",
      "   > Set Default Directory"     => "Export_File_Set_Default_Dir",
      "   > -"                         => 0,
      "   > &Close this window"        => "Export_File_Exit",
  );
  $ExportWindow = new Win32::GUI::DialogBox(
      -name   => "Export_Window",
      -text   => 'Export List to File',
      -height => 300,
      -width  => 450,
      -left   => 15,
      -top    => 15,
      -menu    => $ExportMenu,
  );
  $ExportWindow->AddTabStrip(
        -name   => "Export_List_Tab",
        -left   => 0,  
        -top    => 12,
        -width  => $ExportWindow->ScaleWidth,
        -height => $ExportWindow->ScaleHeight,
        -imagelist => $IL,
  );

  $ExportWindow->Export_List_Tab->InsertItem(
        -text => "Users",
        -image => $IL_USER,
  );
  $ExportWindow->Export_List_Tab->InsertItem(
        -text => "Groups",
        -image => $IL_GROUP,
  );
  $ExportWindow->Export_List_Tab->InsertItem(
        -text => "Computers",
        -image => $IL_WORKSTAT,
  );  foreach $category (keys %{$CFG{'ExportWindowCheckboxes'}}) {
    $top_value=25;
    foreach $cfgentry (sort {lc($a) cmp lc($b)} keys %{$CFG{'ExportWindowCheckboxes'}{$category}} ) {
      $top_value=$top_value+20;
      $ExportWindow->AddCheckbox(
                     -text => $cfgentry,
                     -name => $cfgentry,
                     -width => 250,
                     -left  => 25,
                     -top   => $top_value,
                     );
      $ExportWindow->{$cfgentry}->Checked($CFG{'ExportWindowCheckboxes'}{$category}{$cfgentry});
    }

Reply via email to