* * * *

Privacy Policy

Blog italiano

Clicca qui se vuoi andare al blog italiano su Lazarus e il pascal.

Forum ufficiale

Se non siete riusciti a reperire l'informazione che cercavate nei nostri articoli o sul nostro forum vi consiglio di visitare il
Forum ufficiale di Lazarus in lingua inglese.

Lazarus 1.0

Trascinare un file nel programma
DB concetti fondamentali e ZeosLib
Recuperare codice HTML da pagina web
Mandare mail con Lazarus
Stabilire il sistema operativo
Esempio lista in pascal
File INI
Codice di attivazione
Realizzare programmi multilingua
Lavorare con le directory
Utilizzare Unità esterne
TTreeView
TTreeview e Menu
Generare controlli RUN-TIME
LazReport, PDF ed immagini
Intercettare tasti premuti
Ampliare Lazarus
Lazarus e la crittografia
System Tray con Lazarus
UIB: Unified Interbase
Il file: questo sconosciuto
Conferma di chiusura di un applicazione
Liste e puntatori
Overload di funzioni
Funzioni a parametri variabili
Proprietà
Conversione numerica
TImage su Form e Panel
Indy gestiore server FTP lato Client
PopUpMenu sotto Pulsante (TSpeedButton)
Direttiva $macro
Toolbar
Evidenziare voci TreeView
Visualizzare un file Html esterno
StatusBar - aggirare l'errore variabile duplicata
Da DataSource a Excel
Le permutazioni
Brute force
Indy 10 - Invio email con allegati
La gestione degli errori in Lazarus
Pascal Script
Linux + Zeos + Firebird
Dataset virtuale
Overload di operatori
Lavorare con file in formato JSON con Lazarus
Zeos ... dietro le quinte (prima parte)
Disporre le finestre in un blocco unico (come Delphi)
Aspetto retrò (Cmd Line)
Lazarus 1.0
Come interfacciare periferica twain
Ubuntu - aggiornare free pascal e lazarus
fpcup: installazioni parallele di lazarus e fpc
Free Pascal e Lazarus sul Raspberry Pi
Cifratura: breve guida all'uso dell'algoritmo BlowFish con lazarus e free pascal.
Creare un server multithread
guida all'installazione di fpc trunk da subversion in linux gentoo
Indice
DB concetti fondamentali e connessioni standard
Advanced Record Syntax
DB concetti fondamentali e DBGrid
DB concetti fondamentali e TDBEdit, TDBMemo e TDBText
Advanced Record Syntax: un esempio pratico
Superclasse form base per programmi gestionali (e non)
Superclasse form base per programmi gestionali (e non) #2 - log, exception call stack, application toolbox
Superclasse form base per programmi gestionali (e non) #3 - traduzione delle form
Superclasse form base per programmi gestionali (e non) #4 - wait animation
Un dialog per la connessione al database:TfmSimpleDbConnectionDialog
Installare lazarus su mac osx sierra
immagine docker per lavorare con lazarus e free pascal
TDD o Test-Driven Development
Benvenuto! Effettua l'accesso oppure registrati.
Maggio 27, 2024, 02:44:26 pm

Inserisci il nome utente, la password e la durata della sessione.

30 Visitatori, 0 Utenti

Autore Topic: Testare eseguibile  (Letto 18742 volte)

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Testare eseguibile
« il: Dicembre 22, 2013, 09:10:49 pm »
Buonasera,
ho fatto un programmino che alla fine stampa la form in un file pdf.
Mentre nel mio pc (win7) va tutto bene, nel pc di un amico con win 7 succede che la finestra di salvataggio del file pdf va in crash facendo chiudere anche il programma.
In un altro amico con win 8 il pdf viene salvato su file ma non viene aperto perchè "corrotto".
La fase di stampa l'ho presa da: http://wiki.freepascal.org/Using_the_printer#Advanced_steps:_printing_controls

Se c'è qualcuno che è disponibile ad aprire il file exe per vedere cosa succede gliene sarei grato.
Aspetto vostre news
Grazie mille
Carmelo
Carmelo

bonmario

  • Hero Member
  • *****
  • Post: 1307
  • Karma: +10/-1
Re:Testare eseguibile
« Risposta #1 il: Dicembre 23, 2013, 07:37:58 am »
Ciao,
sarebbe utile sapere quale errore da sul PC del tuo amico, per  avere un'idea di quale possa essere il problema.
Per capire dov'è l'errore, più che il file exe, servirebbero i sorgenti ...

Ciao, Mario

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Re:Testare eseguibile
« Risposta #2 il: Dicembre 23, 2013, 09:29:17 am »
Buondi...
L'errore consiste nella non risposta della finestra di salvataggio del file in pdf (il savedialog per intenderci va in crash) con la chiusura non solo della finestra ma anche di tutta l'applicazione.
Allego qui il sorgente della pagina in cui è inserito il codice per la stampa.
Se può essere utile allego tutto il progetto zippato.

Codice: [Seleziona]
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics, Dialogs,
  StdCtrls, ExtCtrls, EditBtn, ComCtrls, printers, Grids, Buttons, ValEdit,
  Unit2;

type

  { TForm1 }

  TForm1 = class(TForm)
    AddBtn: TBitBtn;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    CheckBox1: TCheckBox;
    CheckBox10: TCheckBox;
    CheckBox11: TCheckBox;
    CheckBox12: TCheckBox;
    CheckBox13: TCheckBox;
    CheckBox14: TCheckBox;
    CheckBox15: TCheckBox;
    CheckBox16: TCheckBox;
    CheckBox17: TCheckBox;
    CheckBox18: TCheckBox;
    CheckBox19: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox20: TCheckBox;
    CheckBox21: TCheckBox;
    CheckBox22: TCheckBox;
    CheckBox23: TCheckBox;
    CheckBox24: TCheckBox;
    CheckBox25: TCheckBox;
    CheckBox26: TCheckBox;
    CheckBox27: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    CheckBox5: TCheckBox;
    CheckBox6: TCheckBox;
    CheckBox7: TCheckBox;
    CheckBox8: TCheckBox;
    CheckBox9: TCheckBox;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    ComboBox3: TComboBox;
    ComboBox4: TComboBox;
    ComboBox5: TComboBox;
    ComboBox6: TComboBox;
    DateEdit1: TDateEdit;
    Edit1: TEdit;
    Edit10: TEdit;
    Edit11: TEdit;
    Edit14: TEdit;
    Edit15: TEdit;
    Edit18: TEdit;
    Edit19: TEdit;
    Edit2: TEdit;
    Edit20: TEdit;
    Edit21: TEdit;
    Edit22: TEdit;
    Edit23: TEdit;
    Edit24: TEdit;
    Edit25: TEdit;
    Edit26: TEdit;
    Edit7: TEdit;
    Edit8: TEdit;
    Edit9: TEdit;
    Label18: TLabel;
    Label21: TLabel;
    Label27: TLabel;
    Label3: TLabel;
    Label35: TLabel;
    Label36: TLabel;
    Label37: TLabel;
    Label38: TLabel;
    Label39: TLabel;
    Label4: TLabel;
    Label40: TLabel;
    Label41: TLabel;
    Label42: TLabel;
    Label43: TLabel;
    Label44: TLabel;
    Label45: TLabel;
    Label46: TLabel;
    Label47: TLabel;
    Label48: TLabel;
    Label49: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Panel27: TPanel;
    Edit16: TEdit;
    Panel28: TPanel;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    Image1: TImage;
    Label1: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label19: TLabel;
    Label2: TLabel;
    Label20: TLabel;
    Label26: TLabel;
    Label29: TLabel;
    Label30: TLabel;
    Label31: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    OpenDialog1: TOpenDialog;
    Panel1: TPanel;
    Panel10: TPanel;
    Panel11: TPanel;
    Panel12: TPanel;
    Panel13: TPanel;
    Panel14: TPanel;
    Panel15: TPanel;
    Panel16: TPanel;
    Panel17: TPanel;
    Panel18: TPanel;
    Panel19: TPanel;
    Panel2: TPanel;
    Panel20: TPanel;
    Panel21: TPanel;
    Panel22: TPanel;
    Panel23: TPanel;
    Panel24: TPanel;
    Panel25: TPanel;
    Panel26: TPanel;
    Panel29: TPanel;
    Panel3: TPanel;
    Panel30: TPanel;
    Panel31: TPanel;
    Panel32: TPanel;
    Panel33: TPanel;
    Panel34: TPanel;
    Panel35: TPanel;
    Panel36: TPanel;
    Panel37: TPanel;
    Panel38: TPanel;
    Panel39: TPanel;
    Panel4: TPanel;
    Panel40: TPanel;
    Panel41: TPanel;
    Panel5: TPanel;
    Panel6: TPanel;
    Panel7: TPanel;
    Panel8: TPanel;
    Panel9: TPanel;
    PrintDialog1: TPrintDialog;
    RadioButton1: TRadioButton;
    RadioButton10: TRadioButton;
    RadioButton11: TRadioButton;
    RadioButton12: TRadioButton;
    RadioButton13: TRadioButton;
    RadioButton14: TRadioButton;
    RadioButton15: TRadioButton;
    RadioButton16: TRadioButton;
    RadioButton17: TRadioButton;
    RadioButton18: TRadioButton;
    RadioButton19: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton20: TRadioButton;
    RadioButton21: TRadioButton;
    RadioButton22: TRadioButton;
    RadioButton23: TRadioButton;
    RadioButton24: TRadioButton;
    RadioButton25: TRadioButton;
    RadioButton26: TRadioButton;
    RadioButton27: TRadioButton;
    RadioButton28: TRadioButton;
    RadioButton29: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton30: TRadioButton;
    RadioButton31: TRadioButton;
    RadioButton32: TRadioButton;
    RadioButton33: TRadioButton;
    RadioButton34: TRadioButton;
    RadioButton35: TRadioButton;
    RadioButton36: TRadioButton;
    RadioButton37: TRadioButton;
    RadioButton38: TRadioButton;
    RadioButton39: TRadioButton;
    RadioButton4: TRadioButton;
    RadioButton40: TRadioButton;
    RadioButton41: TRadioButton;
    RadioButton42: TRadioButton;
    RadioButton43: TRadioButton;
    RadioButton44: TRadioButton;
    RadioButton45: TRadioButton;
    RadioButton46: TRadioButton;
    RadioButton47: TRadioButton;
    RadioButton48: TRadioButton;
    RadioButton49: TRadioButton;
    RadioButton5: TRadioButton;
    RadioButton50: TRadioButton;
    RadioButton51: TRadioButton;
    RadioButton52: TRadioButton;
    RadioButton53: TRadioButton;
    RadioButton54: TRadioButton;
    RadioButton55: TRadioButton;
    RadioButton56: TRadioButton;
    RadioButton57: TRadioButton;
    RadioButton58: TRadioButton;
    RadioButton59: TRadioButton;
    RadioButton6: TRadioButton;
    RadioButton60: TRadioButton;
    RadioButton61: TRadioButton;
    RadioButton62: TRadioButton;
    RadioButton63: TRadioButton;
    RadioButton64: TRadioButton;
    RadioButton65: TRadioButton;
    RadioButton66: TRadioButton;
    RadioButton67: TRadioButton;
    RadioButton68: TRadioButton;
    RadioButton69: TRadioButton;
    RadioButton7: TRadioButton;
    RadioButton70: TRadioButton;
    RadioButton71: TRadioButton;
    RadioButton8: TRadioButton;
    RadioButton9: TRadioButton;
    SaveDialog1: TSaveDialog;
    Shape1: TShape;
    edit17: TStaticText;
    ToolBar1: TToolBar;
    procedure AddBtnClick(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure CheckBox5Change(Sender: TObject);
    procedure ComboBox5Change(Sender: TObject);
    procedure Edit16Change(Sender: TObject);
    procedure Edit1Change(Sender: TObject);
    procedure Edit4Change(Sender: TObject);
    procedure Edit6Change(Sender: TObject);
    procedure Edit8Change(Sender: TObject);
    procedure Edit9Change(Sender: TObject);
    procedure RadioButton14Change(Sender: TObject);
    procedure RadioButton18Change(Sender: TObject);
    procedure RadioButton19Change(Sender: TObject);
    procedure RadioButton23Change(Sender: TObject);
    procedure RadioButton36Change(Sender: TObject);
    procedure RadioButton38Change(Sender: TObject);
    procedure RadioButton40Change(Sender: TObject);
    procedure RadioButton42Change(Sender: TObject);
    procedure RadioButton43Change(Sender: TObject);
    procedure RadioButton46Change(Sender: TObject);
    procedure RadioButton49Change(Sender: TObject);
    procedure RadioButton50Change(Sender: TObject);
    procedure RadioButton59Change(Sender: TObject);
    procedure RadioButton5Change(Sender: TObject);
    procedure RadioButton64Change(Sender: TObject);
    procedure RadioButton8Change(Sender: TObject);


  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
  n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, ntot: integer;

implementation

{$R *.lfm}

{ TForm1 }




procedure TForm1.Button2Click(Sender: TObject);
var
      MyPrinter : TPrinter;
      myBitMap : TBitMap;
    begin
      myBitMap := TBitMap.Create;
      myBitMap.Width := panel1.Width;
      myBitMap.Height := panel1.Height;
      panel1.BorderStyle:=bsNone;
      panel1.PaintTo(myBitMap.Canvas, 0, 0);
      panel1.BorderStyle:=bsSingle;
      //
      MyPrinter := Printer;
      MyPrinter.BeginDoc;
        //page.PaintTo(myPrinter.Canvas, 0, 0);
        //myPrinter.Canvas.Draw(0,0, myBitMap);
        myPrinter.Canvas.CopyRect(Classes.Rect(0, 0, myPrinter.PaperSize.Width, myPrinter.PaperSize.Height),
           myBitMap.Canvas, Classes.Rect(0, 0, myBitMap.Width, myBitMap.Height));
      MyPrinter.EndDoc;
      myBitMap.Free;
    end;

procedure TForm1.Button1Click(Sender: TObject);
var
F: TextFile;
S: string;
begin
  opendialog1.Filter := 'GPP files (*.GPP)|*.GPP';
  if OpenDialog1.Execute then            { Display Open dialog box }
  begin
    AssignFile(F, OpenDialog1.FileName); { File selected in dialog }
    Reset(F);
    Readln(F, S);                        { Read first line of file }
    dateedit1.Text := S;
    Readln(F, S);
    combobox1.Text := S;
    Readln(F, S);
    combobox2.Text := S;
    Readln(F, S);
    combobox3.Text := S;
    Readln(F, S);
    edit1.Text := S;
    Readln(F, S);
    edit3.Text := S;
    Readln(F, S);
    edit4.Text := S;
    Readln(F, S);
    edit6.Text := S;
    Readln(F, S);
    edit5.Text := S;
    Readln(F, S);
    edit7.Text := S;
    Readln(F, S);
    edit8.Text := S;
    CloseFile(F);
  end;
end;

procedure TForm1.AddBtnClick(Sender: TObject);
begin
  ntot:=n1+n2+n3+n4+n5+n6+n7+n8+n9+n10+n11+n12+n13+n14;
  edit11.Caption:=inttostr(ntot);
end;

procedure TForm1.Button3Click(Sender: TObject);
var
F: TStringList;
begin
  SaveDialog1.Filter := 'GPP files (*.GPP)|*.GPP';
if SaveDialog1.Execute then
begin
F := TStringList.Create;
with F do
begin
Add(label7.Caption);
Add(label21.Caption);
Add(dateedit1.Text);
Add(combobox1.Text);
Add(combobox2.Text);
Add(combobox3.Text);
Add(edit1.Text);
Add(edit3.Text);
Add(edit4.Text);
Add(edit6.Text);
Add(edit5.Text);
Add(edit7.Text);


SaveToFile(Savedialog1.Filename);
Free;
end;
end;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  form1.Close;
end;

procedure TForm1.Button5Click(Sender: TObject);
  var
  i : Integer;
  buttonSelected : Integer;
  begin
  // Show a confirmation dialog
  buttonSelected := MessageDlg('I dati verranno cancellati. Continuare?',mtError, mbOKCancel, 0);

  // Show the button type selected
  if buttonSelected = mrOK     then
    begin
  for i := 0 to ComponentCount-1 do
    if (Components[i] is TEdit) then
      TEdit(Components[i]).Text := '';
  end;
  if buttonSelected = mrCancel then exit;
end;

procedure TForm1.CheckBox5Change(Sender: TObject);
begin
  if checkbox5.Checked=true
  then
    panel41.Enabled:=true else
        panel41.Enabled:=false;
end;



procedure TForm1.ComboBox5Change(Sender: TObject);
begin
  EDIT17.caption:=combobox5.Text + edit11.Text;
end;

procedure TForm1.Edit16Change(Sender: TObject);
var x:integer;
begin
  x:=strtoint(edit16.Caption);
  if x < 13 then n4:=0 else n4:=1;

end;

procedure TForm1.Edit1Change(Sender: TObject);
var y:integer;
begin
  y:=strtoint(edit1.Caption);
  if y < 5 then n2:=0 else n2:=1;
end;

procedure TForm1.Edit4Change(Sender: TObject);
begin
  LABEL7.Caption:='AGGREGATO STRUTTURALE: ' + edit4.Text+ ' '+ edit8.text;;
end;

procedure TForm1.Edit6Change(Sender: TObject);
begin
  LABEL21.Caption:='UNITA'' STRUTTURALE: ' + edit6.Text +' '+ edit9.text;;
end;

procedure TForm1.Edit8Change(Sender: TObject);
begin
  LABEL7.Caption:='AGGREGATO STRUTTURALE: ' + edit4.Text+ ' '+ edit8.text;;
end;

procedure TForm1.Edit9Change(Sender: TObject);
begin
  LABEL21.Caption:='UNITA'' STRUTTURALE: ' + edit6.Text + ' '+ edit9.text;;
end;

procedure TForm1.RadioButton14Change(Sender: TObject);
begin
  if radiobutton14.Checked=true then n3:=0 else n3:=1;
end;

procedure TForm1.RadioButton18Change(Sender: TObject);
begin
  if radiobutton18.Checked=true then n9:=0 else n9:=1;
end;

procedure TForm1.RadioButton19Change(Sender: TObject);
begin
  if radiobutton19.Checked=true then n9:=0 else n9:=1;
end;

procedure TForm1.RadioButton23Change(Sender: TObject);
begin
   if radiobutton23.Checked=true then n10:=0 else n10:=1;
end;

procedure TForm1.RadioButton36Change(Sender: TObject);
begin
  if radiobutton36.Checked=true then n7:=1 else n7:=0;
end;

procedure TForm1.RadioButton38Change(Sender: TObject);
begin
  if radiobutton38.Checked=true then n6:=1 else n6:=0;
end;

procedure TForm1.RadioButton40Change(Sender: TObject);
begin
  if radiobutton40.Checked=true then n5:=1 else n5:=0;
end;

procedure TForm1.RadioButton42Change(Sender: TObject);
begin
   if radiobutton42.Checked=true then n12:=1 else n12:=0;
end;

procedure TForm1.RadioButton43Change(Sender: TObject);
begin
   if radiobutton43.Checked=true then n12:=1 else n12:=0;
end;

procedure TForm1.RadioButton46Change(Sender: TObject);
begin
  if radiobutton46.Checked=true then n14:=1 else n14:=0;
end;

procedure TForm1.RadioButton49Change(Sender: TObject);
begin
  if radiobutton49.Checked=true then n13:=1 else n13:=0;
end;

procedure TForm1.RadioButton50Change(Sender: TObject);
begin
  if radiobutton50.Checked=true then n13:=1 else n13:=0;
end;

procedure TForm1.RadioButton59Change(Sender: TObject);
begin
   if radiobutton59.Checked=true then n11:=0 else n11:=1;
end;

procedure TForm1.RadioButton5Change(Sender: TObject);
begin
  if radiobutton5.Checked= true then n8:=0 else n8:=1;
end;

procedure TForm1.RadioButton64Change(Sender: TObject);
begin
  if radiobutton64.Checked=true then
    panel40.Enabled:=true else
          panel40.Enabled:=false;
end;

procedure TForm1.RadioButton8Change(Sender: TObject);
begin
  if radiobutton8.Checked= true then
    panel6.Enabled:=true else
      panel6.Enabled:=false;
  if radiobutton8.Checked=true then n1:=1 else n1:=0;
end;



end.

Carmelo

bonmario

  • Hero Member
  • *****
  • Post: 1307
  • Karma: +10/-1
Re:Testare eseguibile
« Risposta #3 il: Dicembre 23, 2013, 01:23:06 pm »
Sarebbe meglio lo zip dei sorgenti.
Ma quando va in crash, non da errori?

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Re:Testare eseguibile
« Risposta #4 il: Dicembre 23, 2013, 02:32:52 pm »
non esce nessun messaggio di errore...allego tutto

https://www.dropbox.com/s/nb73d7udvcelfhi/Nuova%20cartella%20-%20Copia.rar
Carmelo

Stilgar

  • Global Moderator
  • Hero Member
  • *****
  • Post: 2382
  • Karma: +10/-0
Re:Testare eseguibile
« Risposta #5 il: Dicembre 23, 2013, 02:33:30 pm »
E' questo il metodo incriminato?

Un pochino di debug lo hai fatto?

Codice: [Seleziona]
procedure TForm1.Button3Click(Sender: TObject);
var
  F: TStringList;
begin
  SaveDialog1.Filter := 'GPP files (*.GPP)|*.GPP';
  if SaveDialog1.Execute then
  begin
    F := TStringList.Create;
    with F do
    begin
       Add(label7.Caption);
       Add(label21.Caption);
       Add(dateedit1.Text);
       Add(combobox1.Text);
       Add(combobox2.Text);
       Add(combobox3.Text);
       Add(edit1.Text);
       Add(edit3.Text);
       Add(edit4.Text);
       Add(edit6.Text);
       Add(edit5.Text);
       Add(edit7.Text);
    end;
    F.SaveToFile(Savedialog1.Filename);
    F.Free;
   end;
end;
Al mondo ci sono 10 tipi di persone ... chi capisce il binario e chi no.

Stilgar

  • Global Moderator
  • Hero Member
  • *****
  • Post: 2382
  • Karma: +10/-0
Re:Testare eseguibile
« Risposta #6 il: Dicembre 23, 2013, 02:38:11 pm »
Eseguito senza errori ....
Al mondo ci sono 10 tipi di persone ... chi capisce il binario e chi no.

xinyiman

  • Administrator
  • Hero Member
  • *****
  • Post: 3253
  • Karma: +12/-0
Re:Testare eseguibile
« Risposta #7 il: Dicembre 23, 2013, 04:57:22 pm »
curiosità che nome assegni al file da salvare nei tuoi test e cosa ne fai poi di questo file?
Ieri è passato, domani è futuro, oggi è un dono...

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Re:Testare eseguibile
« Risposta #8 il: Dicembre 23, 2013, 05:57:53 pm »
Allora, i problemi sono due:

1) Il salvataggio del file con estensione *.gpp, ovvero proprio il codice evidenziato da Stilgar.
In questo caso, la finestra di salvataggio si apre e si chiude da sola subito facendo chiudere tutto il programma.

2)La stampa in formato pdf. Cliccando il tasto Printtopdf, sempre nel pc dell'amico, spunta la iconcina della stampante, come se volesse partire la stampa in pdf, ma in realtà non stampa nessun file pdf. Il programma in questo caso non si chiude.

Tutti questi problemi nel mio pc con seven non ci sono.

Al file nei test assegno qualsiasi nome (aa.gpp, ss.gpp, ciao.gpp), lo salvo nel desktop e poi lo riapro per vedere se funziona la procedura opendialog. E funziona anche questo da me...

Se da voi funziona allora che può essere?
Carmelo

bonmario

  • Hero Member
  • *****
  • Post: 1307
  • Karma: +10/-1
Re:Testare eseguibile
« Risposta #9 il: Dicembre 24, 2013, 07:40:50 am »
Scusami, ma al momento non ho nessun PC con Win7 per fare il test.
Se il programma crasha senza dare errori, potresti provare così:
- vai in Progetto ==> Opzioni progetto
- selezioni "Config and target" sulla sinistra
- deselezioni il campo "Applicazione GUI Win32"

Compili il programma e poi lo lanci dal prompt di DOS.
In questo modo, quando va in crash, al prompt di DOS dovresti avere dei messaggi che, se sei fortunato, tia aiutano a capire dov'è il problema.

Ciao, Mario

Stilgar

  • Global Moderator
  • Hero Member
  • *****
  • Post: 2382
  • Karma: +10/-0
Re:Testare eseguibile
« Risposta #10 il: Dicembre 24, 2013, 09:14:22 am »
I test li ho eseguiti in un Win7 ...

Stilgar
Al mondo ci sono 10 tipi di persone ... chi capisce il binario e chi no.

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Re:Testare eseguibile
« Risposta #11 il: Dicembre 24, 2013, 09:18:22 am »
stavo pensando che magari il problema nella fase di stampa su file pdf potrebbe essere causato dalla presenza o meno su windows di una stampante virtuale che stampa in pdf tipo cutepdf...potrebbe essere?
Carmelo

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Re:Testare eseguibile
« Risposta #12 il: Dicembre 24, 2013, 10:01:34 am »
Ho capito il problema della stampa in pdf.
In realtà, il codice che io pensavo mi facesse stampare sul file pdf, mi consente di stampare si, ma sulla stampante predefinita. Se la stampante predefinita è ad es. cutepdf, allora riesco a stampare in pdf. Ho cambiato la stampante predefinita di sistema impostando la canon ed effettivamente la stampa si avvia ma sulla canon.
Ho interpretato io male il codice.

Fermo restando il problema del salvataggio del file *.gpp, a questo punto mi chiedo: Come posso stampare in pdf senza usare stampanti virtuali?
Powerpdf potrebbe fare al caso mio?
Grazie ancora
Carmelo

xinyiman

  • Administrator
  • Hero Member
  • *****
  • Post: 3253
  • Karma: +12/-0
Re:Testare eseguibile
« Risposta #13 il: Dicembre 24, 2013, 02:53:14 pm »
Perfetto, allora inizi a dare un occhiata qui.

http://www.lazaruspascal.it/index.php?page=47
Ieri è passato, domani è futuro, oggi è un dono...

carmelo81

  • Newbie
  • *
  • Post: 48
  • Karma: +0/-0
Re:Testare eseguibile
« Risposta #14 il: Dicembre 30, 2013, 11:13:09 am »
grazie per il consiglio.
Ho provato ma mi da degli errori che non so decifrare.
Poi da quello che ho capito di lazreport, devo creare un foglio pdf base dove inserire tutti i componenti e richiamarlo per poi stamparlo. Solo che, come si vede nel mio progetto allegato, ho gia creato la form con miriade di componenti e quindi è un po seccante e non so neanche se si possa fare, ricopiarli nella pagina pdf.
Ho provato powerpdf, più intuitivo per un neofita come me.
Domanda:
I componenti che posso stampare in pdf sono solo quelli nativi di power pdf oppure posso anche stampare anche i componenti di lazarus?
Lo chiedo perchè non sono riuscito a stamparli.
Grazie mille
Carmelo

 

Recenti

How To

Utenti
  • Utenti in totale: 789
  • Latest: iembod
Stats
  • Post in totale: 18855
  • Topic in totale: 2244
  • Online Today: 57
  • Online Ever: 900
  • (Gennaio 21, 2020, 08:17:49 pm)
Utenti Online
Users: 0
Guests: 30
Total: 30

Disclaimer:

Questo blog non rappresenta una testata giornalistica poiché viene aggiornato senza alcuna periodicità. Non può pertanto considerarsi un prodotto editoriale ai sensi della legge n. 62/2001.