Key MFC Classes

Chapter 6 - Working with Data

Visual C++ 6: The Complete Reference
Chris H. Pappas and William H. Murray, III
  Copyright 1998 The McGraw-Hill Companies

Standard C and C++ Libraries
Certain calculations are routinely performed in many programs and are written by almost all programmers. Taking the square root of a number is an example of such a calculation. Mathematical procedures for calculating square roots make use of combinations of the basic arithmetic operations of addition, subtraction, multiplication, and division.
It would be a waste of effort if every programmer had to design and code a routine to calculate the square root and then to incorporate that routine into the program. C and C++ resolve difficulties like this by providing you with libraries of functions that perform particular common calculations. With the libraries, you need only a single statement to invoke such a function.
This section discusses functions that are commonly provided with the C and C++ compiler. These library functions are usually not provided in source form but in compiled form. When linking is performed, the code for the library functions is combined with the compiled programmer’s code to form the complete program.
Library functions not only perform mathematical operations, they also deal with many other commonly encountered operations. For example, there are library functions that deal with reading and writing disk files, managing memory, input/output, and a variety of other operations. Library functions are not part of standard C or C++, but virtually every system provides certain library functions.
Most library functions are designed to use information contained in particular files that are supplied with the system. These files, therefore, must be included when the library functions are used, and are provided with the Visual C/C++ compiler. They usually have the extension .H and are called header files. To see the most up-to-date list of header files supplied with your Microsoft Visual C++ Development Studio, route your File Manager over to the \include subdirectory, found nested within the Development Studio subdirectory. Table 6-5 lists many of the more frequently used header files.
Table 6-5: Header Files Shipped with Visral C++
Header
Size
Header
Size
ACCCTRL.H
8,711
NDDESEC.H
3,146
ACLAPI.H
14,090
NEW.H
2,509
ACTIVSCP.H
45,596
NSPAPI.H
18,996
ALPHAOPS.H
43,059
NTSDEXTS.H
1,502
ASPTLB.H
17,564
OAIDL.H
197,254
ASSERT.H
1,469
OBJBASE.H
30,028
ATALKWSH.H
4,608
OBJERROR.H
301
BASETYPS.H
8,965
OBJIDL.H
330,903
CDERR.H
2,197
OBJSAFE.H
7,808
CGUID.H
3,497
OCIDL.H
244,528
COLORDLG.H
1,434
ODBCINST.H
15,315
COMCAT.H
32,382
OLE.H
25,650
COMDEF.H
39,062
OLE2.H
12,682
COMIP.H
22,023
OLE2VER.H
664
COMMCTRL.H
131,448
OLEAUTO.H
33,100
COMMDLG.H
28,166
OLECTL.H
20,424
COMPOBJ.H
435
OLECTLID.H
824
COMUTIL.H
43,037
OLEDLG.H
74,489
CONIO.H
3,183
OLEIDL.H
159,627
CPL.H
8,282
OLENLS.H
22,637
CPLEXT.H
2,158
OSTREAM.H
4,908
CRTDBG.H
13,860
PBT.H
1,409
CTL3D.H
2,673
PCRT32.H
1,534
CTYPE.H
12,848
PDH.H
16,235
CUSTCNTL.H
8,537
PDHMSG.H
8,303
CUSTOMAW.H
3,368
PENWIN.H
106,402
D3D.H
18,414
PLAN32.H
915
D3DCAPS.H
13,527
POPPACK.H
1,023
D3DRM.H
5,488
PROCESS.H
9,450
D3DRMDEF.H
14,133
PRSHT.H
12,580
D3DRMOBJ.H
32,372
PSHPACK1.H
911
D3DRMWIN.H
1,180
PSHPACK2.H
911
D3DTYPES.H
31,957
PSHPACK4.H
911
DAOGETRW.H
5,143
PSHPACK8.H
911
DBDAOERR.H
69,776
RAS.H
32,269
DBDAOID.H
11,933
RASDLG.H
6,445
DBDAOINT.H
43,043
RASERROR.H
18,219
DBT.H
10,633
RASSAPI.H
10,573
DDE.H
5,072
RASSHOST.H
4,620
DDEML.H
17,868
RECGUIDS.H
567
DDRAW.H
102,313
RECONCIL.H
5,560
DIGITALV.H
37,699
REGSTR.H
60,127
DIRECT.H
3,595
RICHEDIT.H
29,848
DISPATCH.H
437
RICHOLE.H
6,473
DISPDIB.H
11,161
RPC.H
1,983
DLCAPI.H
33,975
RPCDCE.H
42,018
DLGS.H
5,692
RPCDCEP.H
9,678
DOCOBJ.H
51,721
RPCNDR.H
75,799
DOS.H
4,605
RPCNSI.H
14,654
DPLAY.H
10,913
RPCNSIP.H
1,176
DRIVINIT.H
34
RPCNTERR.H
1,569
DSOUND.H
13,356
RPCPROXY.H
18,105
DVOBJ.H
424
SCODE.H
214
EH.H
2,144
SCRNSAVE.H
8,622
ERRNO.H
2,641
SEARCH.H
2,559
ERROR.H
14,337
SEHMAP.H
557
EXCHEXT.H
30,413
SERVPROV.H
5,953
EXCHFORM.H
1,796
SETJMP.H
8,092
EXCPT.H
3,960
SETJMPEX.H
956
EXDISP.H
10,024
SETUPAPI.H
102,225
EXDISPID.H
1,518
SHARE.H
828
FCNTL.H
2,292
SHELLAPI.H
16,824
FLOAT.H
11,052
SHLGUID.H
4,747
FPIEEE.H
5,260
SHLOBJ.H
94,740
FSTREAM.H
4,619
SIGNAL.H
2,833
FTSIFACE.H
6,789
SMPAB.H
1,233
HLIFACE.H
1,879
SMPMS.H
1,892
HLINK.H
69,266
SMPXP.H
3,778
HTTPEXT.H
7,775
SNMP.H
16,987
HTTPFILT.H
12,861
SPORDER.H
1,944
IDF.H
12,538
SQL.H
29,810
IDISPIDS.H
430
SQLEXT.H
76,694
IMAGEHLP.H
23,452
SQLTYPES.H
6,621
IME.H
6,939
SQLUCODE.H
22,825
IMESSAGE.H
8,229
STDARG.H
4,730
IMM.H
20,961
STDDEF.H
2,458
INETSDK.H
1,892
STDEXCPT.H
1,935
INITGUID.H
1,442
STDIO.H
13,087
INITOID.H
1,467
STDIOSTR.H
2,082
INTSHCUT.H
15,073
STDLIB.H
19,150
IO.H
7,986
STL.H
6,704
IOMANIP.H
4,408
STORAGE.H
435
IOS.H
9,101
STREAMB.H
5,419
IOSTREAM.H
2,373
STRING.H
9,170
ISGUIDS.H
747
STRSTREA.H
3,074
ISO646.H
419
SVCGUID.H
16,113
ISTREAM.H
6,626
SVRAPI.H
47,005
LARGEINT.H
5,279
TAPI.H
150,246
LIMITS.H
4,133
TCHAR.H
27,828
LM.H
1,284
TIME.H
7,494
LMACCESS.H
40,810
TLHELP32.H
6,068
LMALERT.H
3,738
TNEF.H
14,111
LMAPIBUF.H
1,321
TSPI.H
41,575
LMAT.H
3,576
TYPEINFO.H
2,074
LMAUDIT.H
10,910
UNKNWN.H
9,289
LMBROWSR.H
5,967
URLHLINK.H
89
LMCHDEV.H
5,439
URLMON.H
83,404
LMCONFIG.H
1,698
USE_ANSI.H
812
LMCONS.H
7,239
USEOLDIO.H
1,028
LMERR.H
36,393
VARARGS.H
4,675
LMERRLOG.H
38,479
VARIANT.H
435
LMMSG.H
2,125
VCR.H
20,052
LMREMUTL.H
2,921
VDMDBG.H
13,476
LMREPL.H
6,726
VER.H
113
LMSERVER.H
47,741
VFW.H
139,508
LMSHARE.H
10,475
WCHAR.H
24,960
LMSNAME.H
3,065
WCTYPE.H
7,037
LMSTATS.H
5,134
WDBGEXTS.H
13,287
LMSVC.H
13,334
WFEXT.H
6,531
LMUSE.H
3,641
WINBASE.H
154,540
LMUSEFLG.H
676
WINCON.H
14,592
LMWKSTA.H
16,742
WINCRYPT.H
13,176
LOADPERF.H
1,407
WINDEF.H
6,760
LOCALE.H
3,308
WINDOWS.H
4,903
LSAPI.H
11,774
WINDOWSX.H
73,255
LZEXPAND.H
1,679
WINERROR.H
203,050
MALLOC.H
4,429
WINGDI.H
147,629
MAPI.H
11,857
WININET.H
78,807
MAPICODE.H
10,528
WINIOCTL.H
30,511
MAPIDBG.H
24,876
WINNETWK.H
22,739
MAPIDEFS.H
103,616
WINNLS.H
39,651
MAPIFORM.H
28,081
WINNLS32.H
2,125
MAPIGUID.H
11,650
WINNT.H
179,078
MAPIHOOK.H
2,649
WINPERF.H
28,279
MAPINLS.H
6,893
WINREG.H
14,324
MAPIOID.H
2,759
WINRESRC.H
53,424
MAPISPI.H
47,359
WINSOCK.H
33,611
MAPITAGS.H
68,440
WINSOCK2.H
93,959
MAPIUTIL.H
30,573
WINSPOOL.H
52,635
MAPIVAL.H
90,055
WINSVC.H
19,076
MAPIWIN.H
15,665
WINTRUST.H
11,053
MAPIWZ.H
1,977
WINUSER.H
192,575
MAPIX.H
28,494
WINVER.H
9,504
MATH.H
20,528
WINWLX.H
21,983
MBCTYPE.H
4,712
WOWNT16.H
4,380
MBSTRING.H
7,570
WOWNT32.H
9,744
MCIAVI.H
2,989
WPAPI.H
2,731
MCX.H
3,915
WPGUID.H
800
MEMORY.H
2,660
WPOBJ.H
2,038
MGMTAPI.H
5,210
WPSPI.H
8,411
MIDLES.H
5,962
WS2ATM.H
16,643
MINMAX.H
451
WS2SPI.H
18,485
MMREG.H
69,235
WS2TCPIP.H
2,611
MMSYSTEM.H
154,496
WSHISOTP.H
3,355
MONIKER.H
435
WSIPX.H
1,941
MSACM.H
58,508
WSNETBS.H
2,257
MSACMDLG.H
1,029
WSNWLINK.H
9,315
MSCONF.H
13,545
WSVNS.H
1,250
MSFS.H
16,926
WSVV.H
1,590
MSPAB.H
2,143
WTYPES.H
29,754
MSPST.H
4,977
XCMC.H
14,014
MSSTKPPG.H
1,191
XCMCEXT.H
2,726
MSWSOCK.H
4,189
XCMCMSX2.H
1,039
MTX.H
19,513
XCMCMSXT.H
1,816
MTXATTR.H
1,522
XLOCINFO.H
3,052
MTXSPM.H
26,216
YMATH.H
1,616
NB30.H
12,693
YVALS.H
2,111
NDDEAPI.H
14,642
ZMOUSE.H
7,305
In general, different header files are required by different library functions. The header files a function needs will be listed in the description for that function. For example, the sqrt( ) function needs the declarations found in the MATH.H header file. Your Microsoft Visual C/C++ Run-Time Library Reference lists all of the library functions and their associated header files.
The following list briefly summarizes the library categories provided by the Visual C/C++ compiler:
Classification routines
Conversion routines
Directory control routines
Diagnostic routines
Graphics routines
Input/output routines
Interface routines (DOS, 8086, BIOS)
Manipulation routines
Math routines
Memory allocation routines
Process control routines
Standard routines
Text window display routines
Time and date routines
Check your reference manual for a detailed explanation of the individual functions provided by each library.
After reading this chapter, you should understand C’s basic data types and operators, so it’s time to move on to the topic of logic control. Chapter 7 introduces you to C’s decision, selection, and iteration control statements.

Books24x7.com, Inc 2000 –  


Visual C++ 6(c) The Complete Reference
Visual Studio 6: The Complete Reference
ISBN: B00007FYGA
EAN: N/A
Year: 1998
Pages: 207

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net