1 <?xml version="1.0" encoding="UTF-8" ?>
2 <?xml-stylesheet href="text.css" type="text/css" ?>
4 <title>XML Demonstration of formatting.</title>
5 <author>A.Vynogradov (using some other resources)</author>
7 <phrase>XML is a great tool for creating highly sructured data.</phrase>
8 <phrase>This format offers great possibilities for structuring, controlling, transforming and transferring data.</phrase>
9 <phrase>Also can it be used for designing of decorated documents such as this.</phrase>
10 <phrase>XML documment is an tree structure.</phrase>
11 <phrase>In such form it is easy to process and manage data.</phrase>
14 <phrase>The <important>XML</important> is a standard proposed and maintained by <i>World Wide Web Consorsium</i>.</phrase>
15 <phrase>the main advantage of the XML is a platform independance.</phrase>
16 <phrase>XML documments could be easily created using any of the text edirs widely avalaible.</phrase>
17 <phrase>Version and encoding information is attached to the documment so it can be parsed under any operating system.</phrase>
18 <phrase>The XML is easy to read by human using <important>
20 </important> text editor.</phrase>
21 <phrase>Also it is easy to parse such files and to validate them.</phrase>
24 <title>Part 1. Microsoft Help (the selected)</title>
26 <title>Copyright</title>
28 <phrase>Information in this document, including URL and other Internet Web site
29 references, is subject to change without notice.</phrase>
30 <phrase>Unless otherwise noted, the
31 example companies, organizations, products, domain names, e-mail addresses,
32 logos, people, places and events depicted herein are fictitious, and no
33 association with any real company, organization, product, domain name, e-mail
34 address, logo, person, place or event is intended or should be inferred.</phrase>
36 Complying with all applicable copyright laws is the responsibility of the user.</phrase>
38 Without limiting the rights under copyright, no part of this document may be
39 reproduced, stored in or introduced into a retrieval system, or transmitted in
40 any form or by any means (electronic, mechanical, photocopying, recording, or
41 otherwise), or for any purpose, without the express written permission of
42 Microsoft Corporation.</phrase>
45 <phrase>Microsoft may have patents, patent applications, trademarks, copyrights, or
46 other intellectual property rights covering subject matter in this document.</phrase>
48 Except as expressly provided in any written license agreement from Microsoft,
49 the furnishing of this document does not give you any license to these patents,
50 trademarks, copyrights, or other intellectual property.</phrase>
53 <phrase>© 1987-2001 Microsoft Corporation.</phrase>
54 <phrase>All rights reserved.</phrase>
57 <phrase>Microsoft, MS-DOS, Windows, Windows NT, Microsoft Press, Active
58 Accessibility, Active Channel, Active Client, Active Desktop, Active Directory,
59 ActiveMovie, Active Platform, ActiveStore, ActiveSync, ActiveX, Authenticode,
60 BackOffice, BizTalk, C#, Chromeffects, ClearType, CodeView, DataTips, Developer
61 Studio, Direct3D, DirectAnimation, DirectDraw, DirectInput, DirectMusic,
62 DirectPlay, DirectShow, DirectSound, DirectX, DirectXJ, FoxPro, the Fox head
63 design, FrontPage, IntelliMouse, IntelliSense, J/Direct, JScript, Liquid Motion,
64 Microsoft QuickBasic, Mobile Explorer, MSDN, MSN, Outlook, PivotChart,
65 PivotTable, PowerPoint, QuickAssembler, Rushmore, SourceSafe, Visual Basic, the
66 Visual Basic logo, Visual C++, Visual FoxPro, Visual InterDev, Visual J++,
67 Visual SourceSafe, Visual Studio, the Visual Studio logo, the Visual Tools logo,
68 Verdana, Win32, Win32s, and Win64 are either registered trademarks or trademarks
69 of Microsoft Corporation in the United States and/or other countries.</phrase>
72 <phrase>The names of actual companies and products mentioned herein may be the
73 trademarks of their respective owners.</phrase>
77 <title>Multithreading with C++ and MFC</title>
79 <phrase>A "thread" is a path of execution within a process.</phrase>
80 <phrase>When you start Notepad,
81 the operating system creates a process and begins executing the primary thread
82 of that process.</phrase>
83 <phrase>When this thread terminates, so does the process.</phrase>
85 thread is supplied to the operating system by the startup code in the form of a
86 function address.</phrase>
87 <phrase>Usually, it is the address of the <b>main</b> or
88 <b>WinMain</b> function that is supplied.</phrase>
91 <title>Section 1</title>
93 <phrase>You can create additional threads in your application if you wish.</phrase>
95 want to do this to handle background or maintenance tasks when you don't want
96 the user to wait for them to complete.</phrase>
97 <phrase>All threads in MFC applications are
98 represented by <pre>CWinThread</pre> objects.</phrase>
99 <phrase>In most situations,
100 you don't even have to explicitly create these objects; instead call the
101 framework helper function <pre>AfxBeginThread</pre>, which creates the
102 <B>CWinThread</B> object for you.</phrase>
105 <phrase>MFC distinguishes two types of threads: user-interface threads and worker
107 <phrase>User-interface threads are commonly used to handle user input and
108 respond to events and messages generated by the user.</phrase>
109 <phrase>Worker threads are
110 commonly used to complete tasks, such as recalculation, that do not require user
112 <phrase>The Win32 API does not distinguish between types of threads; it just
113 needs to know the thread's starting address so it can begin to execute the
115 <phrase>MFC handles user-interface threads specially by supplying a message pump
116 for events in the user interface.</phrase>
117 <phrase><B>CWinApp</B> is an example of a
118 user-interface thread object, as it derives from <B>CWinThread</B> and handles
119 events and messages generated by the user.</phrase>
123 <title>Section 2</title>
125 <phrase>Special attention should be given to situations where more than one thread
126 may require access to the same object.</phrase>
127 <phrase>The article <A href="_core_multithreading.3a_.programming_tips.htm">Multithreading: Programming
128 Tips</A> describes techniques you can use to get around problems that may arise
129 in these situations.</phrase>
130 <phrase>The article <A href="_core_multithreading.3a_.how_to_use_the_synchronization_classes.htm">Multithreading:
131 How to Use the Synchronization Classes</A> describes how to use the classes that
132 are available to synchronize access from multiple threads to a single
136 <phrase>Writing and debugging multithreaded programming is inherently a complicated
137 and tricky undertaking, as you must ensure that objects are not accessed by more
138 than one thread at a time.</phrase>
139 <phrase>The articles in the Multithreading group do not teach
140 the basics of multithreaded programming, only how to use MFC in your
141 multithreaded program.</phrase>
142 <phrase>The multithreaded MFC samples included in Visual C++
143 illustrate a few multithreaded Adding Functionality and Win32 APIs not
144 encompassed by MFC, but are only intended to be a starting point.</phrase>
147 <title>Multithreading: Terminating Threads</title>
150 <b>Normal Thread Termination :</b>
151 For a worker thread, normal thread termination is simple: Exit the controlling function and return a value that signifies the reason for termination.</phrase>
152 <phrase>You can use either the AfxEndThread function or a return statement.</phrase>
153 <phrase>Typically, 0 signifies successful completion, but that is up to you.</phrase>
154 <phrase>For a user-interface thread, the process is just as simple: from within the user-interface thread, call PostQuitMessage in the Platform SDK.</phrase>
155 <phrase>The only parameter that PostQuitMessage takes is the exit code of the thread.</phrase>
156 <phrase>As for worker threads, 0 typically signifies successful completion.</phrase>
159 <phrase><b>Premature Thread Termination :</b>
160 Terminating a thread prematurely is almost as simple: Call <pre>AfxEndThread</pre> from within the thread.</phrase>
161 <phrase>Pass the desired exit code as the only parameter.</phrase>
162 <phrase>This stops execution of the thread, deallocates the thread's stack, detaches all DLLs attached to the thread, and deletes the thread object from memory.</phrase>
163 <phrase><pre>AfxEndThread</pre> must be called from within the thread to be terminated.</phrase>
164 <phrase>If you want to terminate a thread from another thread, you must set up a communication method between the two threads.</phrase>
168 <title>Sample application</title>
170 <code><keyword>int</keyword> main(<keyword>int</keyword> argc, <keyword>char</keyword>* argv)
172 <keyword>const int</keyword> counter; <comment>/* this is normal but wierd
173 declaration of a variable */</comment>
174 <keyword>int</keyword> ice9 = <int>10</int>; <comment>// normal variable</comment>
175 <keyword>int</keyword> <error>10ton</error> = <float>20.3</float>; <comment>// errorneous name</comment>
176 cout << <string>"Hello, World..."</string> << <char>'\n'</char> << endl;
177 <breakpoint> cout << <string>"Break point here"</string> << endl; </breakpoint>
178 <keyword>return</keyword> 0; <comment>/* this is the way application should
179 normally terminate*/</comment>
188 <title>Part 2. <important>Multiple</important> different topics</title>
190 <title>XForms - The Next Generation of Web Forms</title>
193 The <b>XForms User Interface</b> provides a standard set of
194 visual controls that are targeted toward replacing today's XHTML form
196 <phrase>These form controls are directly usable inside XHTML and other XML
197 documents, like SVG.</phrase>
198 <phrase>Other groups, such as the Voice Browser Working Group,
199 may also independently develop user interface components for XForms.</phrase>
202 <phrase>An important concept in XForms is that forms collect data, which is
203 expressed as XML <b>instance data</b>.</phrase>
204 <phrase>Among other duties, the
205 XForms Model describes the structure of the instance data.</phrase>
206 <phrase>This is important,
207 since like XML, forms represent a structured interchange of data.</phrase>
209 auto-fill, and pre-fill form applications are supported through the use of
210 instance data.</phrase>
213 <phrase>Finally, there needs to be a channel for instance data to flow to and from
214 the XForms Processor.</phrase>
215 <phrase>For this, the <b>XForms Submit Protocol</b>
216 defines how XForms send and receive data, including the ability to suspend
217 and resume the completion of a form.