myappservimpl.cpp

来自「C++Builder高级应用开发指南随书源码」· C++ 代码 · 共 53 行

CPP
53
字号
#include <vcl.h>
#pragma hdrstop

#include "MYAPPSERVIMPL.H"
#include "Unit1.h"

#if !defined(__PRAGMA_SMART_INIT_DEFINED)
#define __PRAGMA_SMART_INIT_DEFINED
#pragma package(smart_init)
#endif

#pragma resource "*.dfm"


/////////////////////////////////////////////////////////////////////////////
// Global instance of TMyAppServImpl 
/////////////////////////////////////////////////////////////////////////////
TMyAppServ *MyAppServ;


/////////////////////////////////////////////////////////////////////////////
// TMyAppServ::TMyAppServ
/////////////////////////////////////////////////////////////////////////////
__fastcall TMyAppServ::TMyAppServ(TComponent* Owner) : TCRemoteDataModule(Owner)
{
}

//---------------------------------------------------------------------------
void __fastcall TMyAppServ::CRemoteDataModuleCreate(TObject *Sender)
{
    Form1->UpdateClientCount(1);    
}
//---------------------------------------------------------------------------
void __fastcall TMyAppServ::CRemoteDataModuleDestroy(TObject *Sender)
{
    Form1->UpdateClientCount(-1);    
}
//---------------------------------------------------------------------------
void __fastcall TMyAppServ::tbAnimalBeforeOpen(TDataSet *DataSet)
{
    Form1->IncQueryCount();    
}
//---------------------------------------------------------------------------

OleVariant __fastcall TMyAppServ::DataSetProvider1DataRequest(
      TObject *Sender, OleVariant &Input)
{
    Form1->Caption = (WideString) Input;
    return (OleVariant)(true);    
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?