home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / ReadMe.txt < prev    next >
Text File  |  1997-10-25  |  10KB  |  264 lines

  1.                 Multilingual Simple and Power Samples
  2.                 =====================================
  3.  
  4.  
  5. Table of Contents
  6. =================
  7.  
  8.     Overview
  9.     Developing Components
  10.     C++
  11.     ATL
  12.     Installation
  13.     Directory List
  14.     Usage
  15.     Sample ASP scripts
  16.     Support
  17.     Change Notes
  18.  
  19.  
  20. Overview
  21. ========
  22.  
  23. Here, for your edification, are two Active Server Pages components,
  24. each implemented in two different environments: C++/ATL (Microsoft
  25. ActiveX Template Library) and Microsoft Visual Basic 5.
  26.  
  27. The implementations are functionally equivalent.  Each implementation
  28. should behave in exactly the same way.  Each implementation is written
  29. in an idiomatic style to demonstrate the best way to implement the
  30. component in that environment.
  31.  
  32. The Simple component has one method (myMethod) and one property
  33. (myProperty), which can be both retrieved (get) and modified (set).
  34. MyMethod converts a string to uppercase; myProperty is a string in the
  35. object that can be get or set.  There is nothing ASP-specific about
  36. the Simple component and, if desired, it could be used from any OLE
  37. container.
  38.  
  39. The Power component (found in the \intermediate folder) is a superset
  40. of the Simple component.  In addition to myMethod and myProperty, it 
  41. has myPowerMethod and myPowerProperty (gettable but not settable), 
  42. which demonstrate some ASP-specific features.  Two other standard but
  43. optional ASP methods are also provided: OnStartPage and OnEndPage.  
  44. These methods bracket the lifetime of a page.  OnStartPage is needed 
  45. to gain access to the intrinsic ASP objects: Request, Response, 
  46. Server, Application, and Session.
  47.  
  48. MyPowerMethod and myPowerProperty make use of the Request and Response
  49. objects: Request to gain access to the ServerVariables collection and
  50. thereby the ScriptName and the HttpUserAgent (user's browser)
  51. variables; Response to write directly back to the user's browser.
  52. MyPowerProperty returns the name of the ASP script from which it was
  53. called.  MyPowerMethod writes a browser-dependent message back to the
  54. user's browser; one for Microsoft Internet Explorer, a different one
  55. for anything else.
  56.  
  57.  
  58. Developing Components
  59. =====================
  60.  
  61. You can develop ASP components in Visual C++, Visual J++, Visual
  62. Basic, or any other language that builds ActiveX COM objects.
  63.  
  64. These samples are written for IIS 4.0.  You must have the latest
  65. version of IIS to compile and use these components.  You must
  66. also have installed Microsoft Transaction Server (part of the Windows
  67. NT 4.0 Option Pack).
  68.  
  69.  
  70. C++
  71. ===
  72.  
  73. The C++ samples require Microsoft Visual C++ 5.0 or newer along with
  74. ATL (which comes with VC5).
  75.  
  76. If you get an error about "don't know how to make asptlb.h" for the
  77. power samples, you will need to copy
  78.  
  79.     <InstallDir>\iissamples\sdk\include
  80.  
  81. to your include directory, \Program Files\DevStudio\VC\include.  
  82. The default installation directory is C:\Inetpub.
  83.  
  84. Finally you must have the lastest version of MS Transaction Server
  85. installed (part of Windows NT 4.0 Option Pack).  Add the include path 
  86. and library path of MTX before any system directories under
  87. Tools:Options....  So your include path might look like this:
  88. c:\program files\mts\include;c:program files\devstudio\vc\include;...
  89. (depending on where you have installed MTX).
  90.  
  91. If you intend to build from the command line, you must edit 
  92. vcvars32.bat accordingly as well.
  93.  
  94.  
  95. ATL
  96. ===
  97.  
  98. The ATL samples also requires the latest version of ATL (Microsoft
  99. Active Template Library).  ATL ships with Visual C++ 5.0.
  100.  
  101. ATL is the recommended library for writing ASP and other ActiveX
  102. components in C++:
  103.     * produces small, fast, industrial-strength components ("lean and mean")
  104.     * supports all COM threading models (single, apartment, free)
  105.     * supports IDispatch interfaces
  106.     * dual interfaces are easy
  107.     * supports the OLE error mechanism
  108.     * methods are called very quickly
  109.     * fine control over COM features ("closer to the metal")
  110.     * many other features
  111.  
  112. For ATL 2.0, in order to add a method or a property to a component, it
  113. is necessary to modify the .idl, .h, and .cpp files by hand.  With ATL
  114. 2.1, the wizards in Visual C++ 5.0 automates much of this for you.
  115.  
  116. To create a new component with ATL:
  117.     * Start a New Project Workspace in Developer Studio
  118.     * Select ATL COM AppWizard
  119.     * Enter the name and location of the project
  120.     * Hit Create.
  121.     * Accept the defaults and hit Finish.
  122.  
  123. Now that you've created the project, it's time to create a COM object
  124. within the project.  In Visual C++ 5.0, you can go to the Insert menu
  125. where you'll see New ATL Object... or you can right-click on the classes
  126. in the ClassView pane, where you'll also see New ATL Object....
  127.  
  128. When the ATL Object Wizard pops up, you'll see two panes.  In the left
  129. pane, click on Objects.  In the right pane, double-click on Simple Object.
  130. If you have VC 5.0, you'll see a number of additional objects; click on
  131. ActiveX Server Component instead.
  132.  
  133. The ATL Object Wizard Properties dialog will appear.  On the Names tab,
  134. type in the short name of your object.  The other names will be filled in
  135. automatically.  You can edit them if you wish.  It's quite likely that
  136. you'll want to edit the Prog ID.
  137.  
  138. On the Attributes tab, you may want to change the Threading Model to Both.
  139. You probably don't need to support Aggregation.  You ought to Support
  140. ISupportErrorInfo.  The other attributes should not need to be changed.
  141.  
  142. On the ASP tab, you can enable OnStartPage and OnEndPage methods and select
  143. which of the ASP intrinsic objects you want to use.  However, it is now
  144. recommended that you use the Object Context (which doesn't require the
  145. OnStartPage and OnEndPage methods) rather than the Scripting Context (which
  146. is what OnStartPage supplies you with).  This allows you to create more
  147. powerful application state objects.  All the samples that need it use the
  148. Object Context rather than the scripting context.
  149.  
  150. Note the use of the ATL wrapper classes CComBSTR, CComVariant,
  151. CComPtr, and CComQIPtr in the ATL samples to simplify management of
  152. COM data types.
  153.  
  154.  
  155. Installation
  156. ============
  157.  
  158. To install these sample components, you must first compile them with
  159. Microsoft Visual C++.  Load the individual project files into VC++ 
  160. and build the DLLs.  You can also build the DLLs by just typing 
  161. "nmake" in the command line.  Running nmake in the top level directory
  162. (the directory this file is in) will build both the simple and power
  163. DLLs.
  164.  
  165. These components may not compile correctly unless you have the correct
  166. header and library files.  You may need to copy all the header files
  167. in ...\iissamples\sdk\include (default is C:\Inetpub\...) to your VC++ 
  168. include directory.  In addition, you may need to copy the MTS header 
  169. and library files to the VC++ include and library directory.  The MTS 
  170. header files are located in ...\MTS\include (default is C:\Program 
  171. Files\...) while the MTS library files are located in ...\MTS\lib.
  172.  
  173. *** NOTE: The MTS header and library files are not installed by 
  174. default.  In most cases, you will need to install this using the 
  175. Windows NT 4.0 Option Pack setup.
  176.  
  177. If you intend to run these components on a machine other than the one 
  178. on which they are compiled, you will need to copy the DLLs to the 
  179. target machine and
  180.     regsvr32 /s /c SAMPLE.dll
  181. (the samples will be registered automatically on the machine they're
  182. built on).
  183.  
  184. If you have trouble registering components, you may be using the
  185. wrong version of RegSvr32.exe.  Please use the version installed by
  186. default in the directory \<winnt-directory>\system32\inetsrv.
  187.  
  188.  
  189. Directory List
  190. ==============
  191.  
  192. Directory        Description
  193. ---------        -----------
  194.  
  195.  Simple          C++ ATL Simple Sample
  196.  Intermediate    C++ ATL Power Sample
  197.  
  198.  
  199. Usage
  200. =====
  201.  
  202. To use the samples, simply call Server.CreateObject("IISSample.XXX")
  203. to create the object, where "XXX" is one of
  204.     C++ATLSimple     C++ATLPower
  205. Then you may access the object's methods and properties from your ASP
  206. script.  Read any of the sample ASP scripts to discover how to use the
  207. objects.
  208.  
  209.  
  210. Sample ASP scripts
  211. ==================
  212.  
  213. You must copy the sample ASP scripts to a virtual directory (it need
  214. not be a virtual root) on the IIS Server where you have installed the
  215. sample components before they will work.
  216.  
  217.  
  218. Support
  219. =======
  220.  
  221. This component is not officially supported by Microsoft Corporation.
  222. Peer support is available on the Active Server Pages mailing list or on
  223. the microsoft.public.inetserver.iis.activeserverpages newsgroup.
  224.  
  225. To subscribe to the Active Server Pages mailing list, send mail to
  226. listserv@listserv.msn.com with
  227.  
  228. subscribe ActiveServerPages [firstname lastname]
  229.  
  230. in the body of the message, and then follow the directions carefully.
  231. (firstname and lastname are optional.)
  232.  
  233. You can reach the newsgroup through msnews.microsoft.com and other NNTP
  234. servers.
  235.  
  236.  
  237. Change Notes
  238. ============
  239.  
  240. Version 1.0 Beta 1: February 1997
  241. ---------------------------------
  242.  
  243. First release.
  244.  
  245.  
  246. Version 1.0 Beta 2: March 1997
  247. ------------------------------
  248.  
  249. * Fixed Developer Studio makefile problems in C++ components.
  250. * Upgraded to build cleanly with ATL 2.0 (Visual C++ 4.2b) and ATL 2.0 (VC5).
  251. * Better comments in Power components.
  252.  
  253.  
  254. Version 2.0 Beta 3: September 1997
  255. ----------------------------------
  256.  
  257. * Updated for IIS4.0
  258. * Using IObjectContext instead of IScriptingContext.
  259.  
  260.  
  261. Version 2.1: October 1997
  262. -------------------------
  263.  
  264. * Modified for the IIS4.0 SDK release