Author Topic: how to use this comments for sending file?  (Read 1342 times)

cptang

  • Newbie
  • *
  • Posts: 9
    • View Profile
how to use this comments for sending file?
« on: August 26, 2010, 04:27:25 am »
i use it now,it's better.
i think to use it to send file 。
who can give me this demo for bcb6?
my email is cptang@yeah.net
thx!
« Last Edit: August 26, 2010, 09:46:22 am by cptang »

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: how to use this comments for sending file?
« Reply #1 on: August 26, 2010, 07:19:57 pm »
Hello

I'm sorry but I don't understand you.

What do you use now? What is better?
What demo do you need? Zmodem or Kermit?

Please make you question more clear.

Roma Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

cptang

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: how to use this comments for sending file?
« Reply #2 on: September 01, 2010, 03:25:50 am »
Hello

I'm sorry but I don't understand you.

What do you use now? What is better?
What demo do you need? Zmodem or Kermit?

Please make you question more clear.

Roma Novgorodov
DeepSoftware.Com

first, i think u for your replying!

this component is very good!
i like it very much!
i come form china!
i would use this component to send files by serial port.
can you give me this demo for bcb6?  use Zmodem or Kermit .
my email is cptang@yeah.net
thx!
« Last Edit: September 01, 2010, 03:33:06 am by cptang »

cptang

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: how to use this comments for sending file?
« Reply #3 on: September 02, 2010, 02:14:42 pm »
i do it myself!

code
Code: [Select]
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "nrclasses"
#pragma link "nrcomm"
#pragma link "nrdataproc"
#pragma link "nrzmodem"
#pragma link "nrcommbox"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)   
{
    nrComm1->ComPortNo = nrDeviceBox1->ItemIndex + 1 ;
    nrComm1->ConfigDialog() ;

    try
    {
        nrComm1->Active = true ;
        StaticText1->Caption = nrComm1->ComName +  "  ok" ;
    }
    catch(...)
    {
        nrComm1->Active = false ;
        StaticText1->Caption = nrComm1->ComName +  "  error" ;
    }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)   
{
    nrComm1->SendString(Memo1->Text);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)   
{
     if(nrComm1->Active)
        nrComm1->Active = false ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)       
{
    if(OpenDialog1->Execute())
    {
        try
        {
            nrZModem1->Send(OpenDialog1->FileName);
        }
        catch(...)
        {
            nrZModem1->Abort() ;
        }
    }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::nrComm1AfterReceive(TObject *Com, Pointer Buffer,
      DWORD Received)
{
    if(nrZModem1->ModemState == msListen)
        Memo2->Lines->Add((char*)Buffer)  ;
}
//---------------------------------------------------------------------------