2007 9 12 5 JOURNAL OF XI AN UN IV ERSITY OF POST AND TEL ECOMMUN ICA TIONS Sep12007 Vol112 No15 TeeChart (, 710121) : ActiveX TeeChart, Visual C + +,,,, :ActiveX ;;Visual C + + : TP311. 1 :A :1007-3264 (2007) 05-0065 - 05 ActiveX Windows,,, TeeChart, TeeChart, TeeChart VC + + TeeChart ActiveX,, ( 1 ) 1 Tchart 2 TeeChart 1 TeeChart [4 ] TeeChart Steema SL 3,VB Del2 phi MS Office TeeChart TeeChart,56 325 125 28, TChart,, TeeChart, :2007-03 - 06 2. 1 2. 1. 1 :(1966 - ),,, (, TchartCtrl ) TchartCtrl Series Color TchartCtrl, TchartCtrl Series, Color 2. 1. 2 [2 ],Automation
66 2007 9,, 1 ( ) 1 / CurrentSeries Int ConnectionString CString Style3D BOOL IsContinue Graph BOOL LegendType Int SeriesName CString SeriesColor OL E COLOR SQLCommand CString Xsource CString Ysource Cstring Update () void,connectionstring,, Microsoft Access 2000 Microsoft SQL Sever 2000 2. 1. 3, DBC,DAO, ADO,, ADO (ActiveX Data Object) 2. 2 2. 2. 1 [3 ] Connection2 String, SQLCommand, XSource, YSource SQLCommand, SQLCom2 mand XSource Ysource X Y 2 ConnectionString m-connectionstring,sqlcommand m sqlcommand,, ADO : RecordCount, MoveFirst ( ), MoveNext ( ), MoveLast (),ado EOF,adoBOF GetCollect ( b bstr str), 2. 2. 2 2,,,, SQLCommand,SeriesName SeriesColor, CurrentSeries 2. 2. 3 OnDraw ( ),, : (1),, ; ; (2) (3) :,, Style3D IsContiuousGraph ; (4),,,,,, 3 3. 1 [1 ] 3. 1. 1 Series
5 :TeeChart 67 Series : Class CSeries {Public : CString SeriesName ; CString SQLCommand ; OL E COLOR SeriesColor ;} ; CSeries, CurrentSeries, Series2 Name,SQLCommand,SeriesColor 3 3. 1. 2 Color color : class color { int r,g,b ;} ; / /, RED, GREEN,BL U E 3. 1. 3 CTChartCtrl : CTChartCtrl, class CTChartCtrl : public COleControl {DECLARE D YNCREA TE( CTChart Ct rl) CSeries series[ MAX SERIES NUM ] ; CTChartCtrl () ; virtual void OnDraw ( CDC 3 CRect & rcbounds, const CRect & rcinvalid) ; 3 p PX) ; pdc, const virtual void DoProp Exchange (CProp Exchange virtual void OnResetState () ; protected : CTChartCtrl () ; void DrawPie (CDC 3 pdc,color c,int start X, int start Y,int endx,int end Y) ; void Draw2DAxise2 (CDC 3 pdc,int xinteval, int xbase, int yinterval, int ybase, int right, int bot2 tom) ; int isdesigning ; BOOL IsInArray ( CString array [ ], CString str,int current) ; void DrawLabel ( CDC 3 pdc, int x, int y, CString label) ; void Draw2DAxis (CDC 3 pdc,int height,int widt h,int perheight,int ynum,int xnum) ; void SelectColor (color 3 c,int i) ; void DrawLegend (int type, color c, CDC 3 pdc,long x1,long y1,long x2,long y2) ; NUM ] ;} ; Recordset Ptr Init Recordset (int i) ; ConnectionPtr mycon [ MAX 3. 2 SERIES,,SQLCommand,SeriesName SeriesColor CurrentSeries : void CTChart Ct rl : :OnSeriesColorChanged () { SetModifiedFlag () ; this - > series[ this - > m currentseries ]. Seri2 escolor = t his - > m seriescolor ;},Update ( ),, : void CTChartCtrl : :Update () { this - > isdesigning = 1 ; InvalidateCont rol () ;} 3. 3 STDAFX. H, : # importc : \ Program Files \ common Files \ system \ ado \ msado15. dllno namespace rename (EOF,ado EOF ),rename (BOF,adoBOF ) msado15. dll COM (initinstance () ) : ) : i) : :Co Initialize (NULL) ; (exitinstance ( ) : :CoUninitialize () ;, : Recordset Ptr CTChartCtrl : : Init Recordset (int { Recordset Ptr myrs ; CommandPtr cmd ; myrs. Create Instance ( uuidof ( Recordset) ) ; cmd. Create Instance ( uuidof ( Command) ) ;
68 2007 9 try{ mycon[i ] - > Open ( bstr t (this - > m con2 nectionstring),,admodeunknown) ; cmd - > ActiveConnection = mycon[ i ] ; cmd - > CommandText = - bstr-t (this - [i ]. SQLCommand) ; myrs = cmd - CmdText) ; ) ; return myrs ; } catch ( com error e) > series > Execute ( NULL, NULL, ad2 { throw new Cexception ( mycon[i ] - > Close () ; return NULL ;}},, X,,,, Series,,,,, 3. 4 CTChartCTL, DrawLegend (),: void CTChart Ct rl : : DrawLegend (int type,color c, CDC 3 pdc, long x1, long y1, long x2,long y2) { CBrush brush (R GB (c. r,c. g,c. b) ) ; CPen pen ( PS SOL ID,1,R GB (c. r,c. g,c. b) ) ; CBrush 3 oldbrush = pdc - > SelectObject ( &brush) ; CPen 3 oldpen = pdc - > SelectObject ( &pen) ; switch (type) {case RECT : pdc - > Rectangle (x1,y1,x2,y2) ;break ;... default : } break ; pdc - > SelectObject (oldpen) ; pdc - > SelectObject (oldbrush) ;} pdc CDC(device context), 4 TeeChart, VC + + 6. 0 Tchart (, ), VB6. 0, : ACCESS 2000, :, Series0 0104,Series1 0105 Se2 ries2 0106,VB :. XSource = StuHome. YSource = total. SeriesName = 0104. SQLCommand = select count ( 3 ) as total, StuHome from student where StuClass =jk0104 group by StuHome. CurrentSeries = 1. SeriesName = 0105. SQLCommand = select count ( 3 ) as total, StuHome from student where StuClass =jk0105 group by StuHome. CurrentSeries = 2. SeriesName = 0106. SQLCommand = select count ( 3 ) as total, StuHome from student where StuClass =jk0106 group by StuHome. Update 3 4 3
5 :TeeChart 69 4 [1 ]. Visual C + + 6 [ M ]. :,2005. [2 ] Don Box,. COM [ M ]. :,2001. [3 ]. Visual C + + 6. 0 [ M ]. :,2004. [4 ] http :/ / www. steema. com. Design and implementation of a statistical chart imitating TeeChart control Q IAO Ping2an (Department of Computer Science, Xi an University of Post and Telecommunications, Xi an 710121,China) Abstract : This design is a statistic chart control using ActiveX technology to simulate Teechart control, and the development tod is C + +. Its main functionality is to read out data from the Database that is specialized. And t hen after a series of processing and computing, finally came out in a chart way. There are seven kinds of legend type in total. And two of them have both static and animate statuses. Key words :ActiveX control ; statistic chart ; Visual C + + (41 ) The research and application of mobile NFC communication terminals L U Kai,M EN G Xu2dong (College of Communications and Information Engineering, Nanjing University of Posts and Telecommunications ; Nanjing 210003, China) Abstract : Wit h t he development of computer network and telecommunications, people need N FC technology more than ever. This paper first introduces basic characteristics of NFC technologies, presents the NFC technol2 ogy architecture. With the basis, it does further research on mobile NFC Communication Terminals and the function modules. Then the concrete applications of NFC technologies are shown. At last, the paper gives a prospective overview on t he application of mobile N FC Communication Terminals. Key words :NFC ;mobile communication terminal ; contactless ; peer - to - peer