Article View: borland.public.cppbuilder.nativeapi
Article #14179Re: closing app when shutdown computer
From: Francesco
Date: Wed, 03 Sep 2003 12:43
Date: Wed, 03 Sep 2003 12:43
126 lines
4680 bytes
4680 bytes
Hi,
I've finally discovered, the problem is due to a bug in NMUDP component as
declared in NetMaster web site and solved by upgrading the library.
The problem is that as far as i understood the upgrade of NetMaster are not
for free even for bugs included in compiler version :-(((((
"Francesco" <.> ha scritto nel messaggio
news:3f5442ec@newsgroups.borland.com...
> Hi Remy, thank you for the answer,
> this is my code:
>
>
> __fastcall TMainDFM::TMainDFM(TComponent* Owner)
> : TForm(Owner)
> {
> String Path;
> String WPath;
> WPath = ExtractFilePath(Application->ExeName);
> TIniFile* ini = new TIniFile(WPath+"\\Confi.ini");
> Path = ini->ReadString("ATTIVAZIONE", "PATH INTERFACCIAMENTOBACCO", "");
> ADDEEXTRA->DatabaseName = ini->ReadString("ATTIVAZIONE", "ALIAS", "");
> EXTRA->DatabaseName = ini->ReadString("ATTIVAZIONE", "ALIAS", "");
> PRENOTAZIONI->DatabaseName = ini->ReadString("ATTIVAZIONE", "ALIAS",
"");
> if(Path.Length() != 0)
> {
> ADOConnection1->ConnectionString =
> "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source="+Path+"\InterfacciamentoBacco.mdb;Persist Security Info=False";
> }
> else
> {
> ShowMessage("ERRORE IMPOSSIBILE CARICARE
InterfacciamentoBacco.mdb,\nIL
> PERCORSO: '"+Path+"'\nNON E' VALIDO");
> Application->Terminate();
> }
> ADDEEXTRA->Open();
> EXTRA->Open();
> PRENOTAZIONI->Open();
> TrayIcon1->Hint = "ADDEBITA EXTRA BACCO\nin attesa su porta 1011";
> Memo1->Clear();
> }
>
//--------------------------------------------------------------------------
> -
> void __fastcall TMainDFM::TrayIcon1Minimize(TObject *Sender)
> {
> Hide();
> }
>
//--------------------------------------------------------------------------
> -
> void __fastcall TMainDFM::TrayIcon1Restore(TObject *Sender)
> {
> Show();
> }
>
//--------------------------------------------------------------------------
> -
> void __fastcall TMainDFM::CHIUDI1Click(TObject *Sender)
> {
> Close();
> }
>
//--------------------------------------------------------------------------
> -
> void __fastcall TMainDFM::FormClose(TObject *Sender, TCloseAction &Action)
> {
> if(Application->MessageBox("CONFERMI L'USCITA\nDAL PROGRAMMA
> ??","Messaggio",36) == mrYes)
> {
> PRENOTAZIONI->Close();
> ADDEEXTRA->Close();
> EXTRA->Close();
> DETTAGLIO->Close();
> TESTATA->Close();
> if(ADOConnection1->Connected == true)
> ADOConnection1->Connected = false;
> Action = caFree;
> }
> else
> Action = caNone;
> }
>
//--------------------------------------------------------------------------
> -
>
> void __fastcall TMainDFM::XJustOne1AlreadyExist(TObject *Sender)
> {
> ShowMessage("PROGRAMMA GIA' APERTO!");
> }
>
//--------------------------------------------------------------------------
> -
>
> void __fastcall TMainDFM::Esci1Click(TObject *Sender)
> {
> Close();
> }
>
//--------------------------------------------------------------------------
> -
>
> void __fastcall TMainDFM::NMUDP1DataReceived(TComponent *Sender,
> int NumberBytes, AnsiString FromIP, int Port)
> {
> TLocateOptions Opts;
> Opts.Clear();
> Opts << loCaseInsensitive;
> String Buff = "";
> char *Buffer = new char [NumberBytes+2];
> int j = 0;
> NMUDP1->ReadBuffer(Buffer, NumberBytes, j);
> Buffer[j] = 0;
> Buff = Buffer;
> Memo1->Lines->Add(" - "+DateToStr(Date())+" ALLE
> "+TimeToStr(Time())+" ---> "+Buff);
> delete [] Buffer;
> }
>
//--------------------------------------------------------------------------
> -
>
>
Technical Details
Message-ID:
<3f55e1f8@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f536ce7$1@newsgroups.borland.com> <3f53a521$1@newsgroups.borland.com> <3f5442ec@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,681b8ee2fe733ca8 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-03 05:56:06 PST From: "Francesco" <.> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f536ce7$1@newsgroups.borland.com> <3f53a521$1@newsgroups.borland.com> <3f5442ec@newsgroups.borland.com> Subject: Re: closing app when shutdown computer Date: Wed, 3 Sep 2003 14:43:20 +0200 Lines: 128 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 217.172.212.72 Message-ID: <3f55e1f8@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062593016 217.172.212.72 (3 Sep 2003 05:43:36 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail