sample listings
aborting threads, 827–828
abstract classes, 163–164
adding image to .resources file, 896
adding new Monster to DOM tree, 700–703
address of and indirection operators, 84
application configuration file, 892
for array of radio buttons, 402–403
array properties, 151–152
ArrayList, 310–311
ASP.NET GUI design file
Blank2.aspx, 776
Blank.aspx implementing user control, 776
buttons.aspx, 752–753
ChangeColor.aspx, 748–749
color.aspx, 740–741
Happy.aspx, 743–744
Header.ascx, 774
Lists.aspx, 759–760
ManyHeadings.aspx, 779
Tables.aspx, 768–769
assembly referencing in PlayCards.cpp, 193–194
AssemblyInfo.cpp file, 888
BitArray, 314–315
Boolean literals, 71
Boolean types, 48–49
building authors dataset Web service, 804–805
Card.cpp, traditional assembly method, 184–185
Card.h
new assembly method, 189–190
traditional assembly method, 184
Cards.cpp
the Library Linker File, 268–269
new assembly method, 192
CatchAll.exe file, 209–210
CatchException.exe exception handling, 196–197
changing unit of measure and origin, 545–546
character literals, 73
class template, 280
Codebehind
Blank2.aspx.h, 777–778
Buttons.aspx.h, 753–757
ChangeColor.aspx.h, 749–750
Color.aspx.h, 741, 744–746
default Global.asax.h file, 726–727
Header.ascx.h, 774–775
HelloWorld Managed C++, 730–731
Lists.aspx.h, 760–762
ManyHeadings.aspx.h, 779, 780–781
Tables.aspx.h, 769–771
complete card class (.h) file, 276–277
complete deck class (.h) file, 279–280
complete DeckPlayer.cpp file, 284–285
connecting, opening, and closing databases, 626–627
console Web services client application, 801–802
corrected clipping problem, 542–543
counting and summing database records, 637–639
creating
goblin, 680–683
random lines, 572–574
subprocesses, 848–849
customizing forml.h, 382–383
decimal types, 46–47
Deck.cpp: traditional assembly method, 186–187
Deck.h
new assembly method, 190–191
traditional assembly method, 186
default Global.asax file, 725
default Global.asax.h file, 726–727
default Managed C++ Web.config file, 725
default stored procedure code, 621
disabling and hiding panels, 408–411
displaying regions, 556–557
documentation custom attributes, 872–873
documenting class with custom attributes, 876–879
drawing strings
downward in rectangle, 561–562
to rectangle, 559–560
dumping DCV_DB to ListBox, 715–717
EmbeddedResources display function, 902–903
emotional toolbar, 475–478
enums, 54–55
ErrorProvider control, 494–497
Events.exe, 223–226
Filelnfo class, 345–346
FileStream, 353–355
filling with TextureBrush, 578–579
Finally.exe, 211–212
FindZipCodeClass.asmx, 789
FindZipCodeClass.cpp, 788
FindZipCodeClass.h, 789–790
FindZipCode's HTTP POST request, 795
FindZipCode's HTTP POST response, 796
FindZipCode's request SOAP wrapper, 794–795
FindZipCode's response SOAP wrapper, 795
FindZipCode's WSDL, 792–794
floating-point types, 44–45
getting data from two tables, 617
grouping RadioButtons, 405–407
Hashtable and SortedList collections, 319–321
"Hello, World!"
Hello World Default Form1.cpp, 375
Hello World Default Form1.h, 376–377
rendered with GDI+, 530–533
using OnPaint() method, 533–534
HTML to consume FindZipCode Web service, 796–798
implementing
custom dialog box, 520–521
description and history attributes, 874–875
RTF editor, 420–424
indexed properties, 154–155, 156–158
inheritance, 117–118
initial Card.h file, 272
InsertAuthor stored procedures, 622
integer types, 42–43
interfaces, 166–167
Interlocked class, 842–843
intersection, union, or neither, 552–555
invalid Monsters.xml file, 676–677
joining threads, 830–831
Linker File HelloWorld.cpp, 734
ListDictionary, 325–326
ListView of fruit, 452–455
localizable simple application, 910–912
making threads sleep, 824–825
Managed C++ arrays, 59–61
Managed C++ foreach statement, 303–306
member methods, 126–127
MemoryStream, 355–358
MightyLabel, 392–393
mixed data types with operator overloading, 144–145
modifying databases, 635–636
Monsters.dtd file, 673
Monsters.xml file, 675–676
Monsters.xsd file, 674–675
MonthCalendar controls, 490–492
MouseJump, 387–389
multicultural dates, 908
MultiException.exe, 206–207
for MyDialog class file, 517–519
NameValueCollection, 330–332
NotifyIcon control, 498–500
numeric literals, 70
One-Minute Timer, 445–446
operator overloading, 142–143
optimized scrollable happy face, 590–592
original and processed #define directives, 171–172
parsing command line, 102–103
of PictureBox of Shaina, 487–488
piece of art, 583–584
_pin, 121–122
placing OnPaint base class method, 535–537
pointers and references, 123–124
preparing class for serialization, 365–366
printing Happy Face, 602–604
problem using CreateGraphics, 540–541
programming delegates in Delegates.exe, 217–218
Queue and Stack collections, 323–324
radio-checked menu, 510–512
random tree builder, 460–463
reading DOM tree recursively, 693–696
referencing
class members of .NET Framework, 863–865
shared assemblies, 889
rethrowing exceptions, 204–205
retrieving "Doors" stories, 630–634
scalar properties, 147–148
scrolling happy face, 587–589
serializing and deserializing Player class, 368–369, 370–371
setting database parameters, 622
simple menu, 502–504
sleeping/interrupting and suspending/resuming thread, 832–834
sliding happy face double buffer style, 596–599
Splitter control, 470–472
splitting
CheckedListBox control, 439–443
XML Monster File into nodes, 668–672
starting two simple threads, 821–822
static member methods and variables, 128–129
status bar display of x, y coordinates, 483–485
StreamWriter and StreamReader, 360–361
stretching images, 581–582
string literals, 74–75
String type, 52–53
StringCollection, 327–328
StringDictionary, 328–329
structs, 56–57
synchronizing
ComboBoxes, 434–437
ReadWriterLock class, 853–855
with ThreadStatic attribute, 839–841
using Monitor class, 845–846
using Mutex class, 850–851
TabControl control, 466–468
TextBox control, 415–417
throwing exceptions with ThrowDerived.exe, 202
transactional database updates, 641–643
transferring items between ListBoxes, 428–432
updating
authors database Web service, 805–806
Monster DOM tree, 697–699
XML Monster file, 684–686
using reflection to change label properties, 867–869
virtual methods, 135–136
"Way Too Many Buttons!," 395–396
Web server version of MaintAuthors application, 807–811
Windows Form code for localization, 909–910
working with
BinaryReader and BinaryWriter, 362–363
DirectoryInfo, 340–342
writing out four colors from resource, 914
multiculturally, 915
XML Monster File, 662–663
"You Can't Check Me!" code, 398–401
satellite assemblies, 893
localizing Windows application, 912–913
.resources files and, 916
view of in Windows Explorer, 912–913
saving Managed C++ templates, 280–281
scalar properties, 145–149
ScalarProp.exe file, 149
scrollable windows, 585–589
sealed virtual methods, 137
selection controls, 425–443
CheckedListBox, 438–443
ComboBox, 433–437
common properties of ListControl class, 426
ListBox control, 426–433
overview, 425–426
semicolon (;)
in do-while loops, 91
Managed C++ statements ending with, 34
serialization
defined, 335, 364
of managed classes, 364–371
BinaryFormatter, 366–369
choosing format for serialized
data, 366–367
overview, 364
setting up classes for serialization, 364–366
SoapFormatter, 366–367, 369–371
overview, 335
server controls, 729
Server Explorer, 257
illustrated, 610
opening, 609–610
servers
managing with Server Explorer, 257
MSDE 2000 database, 610
Web server version of MaintAuthors application, 807–811
Session object, in Codebehind Color.aspx.h file, 745
shared assemblies, 7, 880–893
application configuration files, 891–893
global assembly cache, 881–882
overview, 880–881
referencing, 887–891
resigning an assembly, 884, 885
signcoded digital signature, 884–885
strong name, 882–884
versioning, 10, 885–887
SharedAssembly.dll, 889–890
SharedAssembly.exe file, 890–891
shift operators, 80
signcoded digital signature, 884–885
SimpleMenu.exe file, 504–505
single threaded program execution, 814
single-threaded apartment (STA), 376
Size and SizeF utility structure, 549–551
skipping loop iterations, 93
Sleep() method for Thread class, 824–825, 831
SOAP (Simple Object Access Protocol), 787–803
as communication protocol, 784–785
request SOAP wrapper, 794–795
response SOAP wrapper, 795
storing serialized class data formatted in, 366–367
Web services and, 783–784
SoapFormatter
BinaryFormatter vs., 366–367
serialization using, 369–371
SolidBrush class, 576
Solution Explorer
about, 256–257
creating Managed C++ Web Form in, 727
removing
Cards.h from, 267
files from, 268
solutions
creating empty, 264–265
projects vs., 264
SortedList collection, 316–321
about, 316–319
defined, 300
sample listing with Hashtables and, 319–321
source (.cpp) files
defined, 177
eliminating need for, 269
illustrated, 178
overview of, 179
specialized collections, 324–332
ListDictionary, 324–326
NameValueCollection, 329–332
StringCollection, 327–328
StringDictionary, 328–329
SplitCLB.exe file, 443
Splitter control, 469–473
adding to Win Form, 469–470
keys to working with, 472
sample listings, 470–472
Splitter.exe file, 473
splitting CheckedListBox control, 439–443
spoofing, 883
SQL Server
ADO.NET and SQL, 607
building stored procedures, 621–622
developing databases in Visual Studio .NET, 609–611
managed provider, 623
SqlCommand SQL statement execution methods, 625
SqlDataAdaptor, 652–655
STA (single-threaded apartment), 376
Stack collection, 322–324
defined, 300
sample listing with Queues and Stacks, 323–324
standard collections, 306–324
ArrayList, 307–312
BitArray, 312–315
Hashtable and SortedList, 316–321
Queue and Stack, 322–324
start element node, 662
Start Page
accessing from Help menu, 262
adding projects to solution from, 267
default page in main development tab window, 262
My Profile link, 263
start tag, 662
StartingThreads.exe file, 822–823
statements
debugging missing break, 87
if, 85–87
Managed C++, 36
switch, 87–89
static members
methods for, 128–129
variables of, 125
static modifier, 65
static properties, 149–150
StaticMethodEx.exe file, 129
StaticProp.exe file, 150
StatusBar control, 481–485
creating as long text area, 481–482
creating with panels, 482–485
status bar display of x, y coordinates, 483–485
StatusBar.exe file, 485
StatusBarPanel control, 482
stopping program execution, 505
stored procedures
building, 621–622
InsertAuthor, 622
setting database parameters, 622
Stream class, 351–352
StreamReader class, 358–361
common members of, 358–359
sample listing of, 360–361
StreamRW.exe file, 360–361
streams for I/O manipulation, 351–352
FileStreams, 352–355
MemoryStreams, 355–358
virtual methods and properties of Stream class, 351–352
StreamWriter class, 358–361
common methods, 359
sample listing of, 360–361
stretching images, 581–582
string literals, 74–75
StringColl.exe file, 328
StringCollection collection, 300, 327–328
StringDict. exe file, 329
StringDictionary collection, 300, 328–329
StringFormat class, 561
StringFun.exe file, 53
StringLiteral.exe, 75
StringRect.exe file, 560
strings
drawing, 558–563
downward in rectangle, 561–562
to rectangle, 559–560
strong name
about, 882–884
signcoding and, 885
structs
classes vs., 119
declaring, 110–119
_gc and _nogc keywords, 113–115
member methods in, 126–145
member variables, 124–125
private, public, and protected member access modifiers, 110–113
sealed classes, 118–119
subprocesses for Mutex class, 848–849
suspending threads, 831–834
switch statement, 87–89
SyncByMonitor.exe file, 847
SyncByMutex.exe file, 851
SyncCombos.exe file, 437
Synchronized Combo boxing dialog box, 437
synchronizing, 837–855
about, 837–838
ComboBoxes, 434–437
Interlocked class, 841–843
Monitor class, 843–847
Mutex class, 847–851
ReadWriterLock class, 852–855
ThreadStatic attribute, 838–841
syntax
adding attribute to class, 870
for conditional directives, 173
explicit cast, 66
general format of Managed C++ functions, 94–95
implementing #define directives, 171–172
include directive search differences, 175
location of preprocessor directives in source code, 170
member variable, 124–125
namespace, 180
throwing ApplicationExceptions, 201–203
XML comment, 662
System::ApplicationException, 200–201
System::Attribute class, 870
System::Collections::Specialized name space, 231–232
System::Collections namespace, 231–232, 299
System::Data namespace, 232–233, 608
System::Delegate class, 213
System::Diagnostics namespace, 234–235
System::DirectoryServices namespace, 235–236
System::Drawing namespace
classes and structures for, 529–530
GDI+ and, 236–237
System::Exception class
exception handling with, 197
member properties, 198
System::Globalization::CultureInfo class, 907
System::Globalization namespace, 237–238, 906
System::IO namespace, 238–240
System::MulticastDelegate class, 213
System::Net::Sockets namespace, 240–241
System::Net namespace, 240–241
System::Object, 227
System::Operating System class, 230
System::Random class, 230
System::Reflection namespace, 241–242, 858
System::Resources namespace, 243
System::Threading namespace, 243–244, 815–816
System::Type class, 858
System::Web::Services::Configuration, 787
System::Web::Services::Description, 787
System::Web::Services::Discovery, 787
System::Web::Services::Protocols, 787
System::Web::Services, 787
System::Web namespace hierarchy, 244–245
System::Windows::Forms namespace, 246–247
System::Xml namespace, 247–248
System.Data.dll, 608
System namespace, 229–230
system pens, 572–574
System.Xml.dll, 608
SystemException
common exceptions in, 199
handling exceptions with, 198–200