Tutorials:
ASP COM Links:
|
|
Tutorial 1 - Simple ASP COM component for Processing GET and POST forms
- Here, my intent is to
show you how to build a simple ASP Component using ATL. This component is not a complex,
commerical quality one but just shows you how easy it is to develop COM components for ASP
using Visual C++. I am quite new at all this and so your constructive criticism and
feedback is eagerly awaited. Please email me at sunitkatkar@hotmail.com
What I used for building this component:
- Microsoft Visual C++ 6.0® (with SP3 applied)
- MS Personal Web Server® (PWS)
- Windows NT 4.0 Workstation® (with SP5 applied)
What I am assuming:
- You have the PWS or IIS4.0 or IIS5.0 configured on your system
- You have a web site running off your local host where you can test this component
- You have enough ASP knowledge to call COM objects from within your ASP pages
- Familiarity with using Visual C++ and basic familiarity with C++ and ATL
- Good reference books for COM and ATL
Design of our component:
- The component will be simple enough. The built-in ASP objects like Response,
Requestand Server
will be used. There will be methods to process form inputs sent via GET and POST, and methods for returning the
number of fields that a form has. The component will be instantiated and released in the
second ASP page which is supposed to process our form data from the first ASP page. For
simplicity the output will be written to the second ASP page.
- This is not a in-depth tutorial on COM as there are many experts and books out there.
Remember that this is my first attempt at learning and sharing my knowledge of COM and especially building ASP
components.
Note:
- Since this is the first tutorial, I am including exhaustive screen shots. In subsequent
tutorials, there will be less of these. I know, for a fact, that screen shots help in many
instances.
Steps for building our component:
| Step 1: |
Start Microsoft Visual C++ and select
New from the File menu. Select ATL COM AppWizard in the Projects tab and call your
project MyForm |
 |
| Figure 1 - Select a ATL COM project |
| Step 2: |
Accept the defaults and click Finish. You will be shown a New Project
Information dialog once you do this. Click on OK on this too. |
|
| Figure 2 - Accept defaults and proceed |
Main |
1 |
2 |
3 |
4 |
5
|