![]() |
Home | Java | Palm OS | ASP COM | XML XSL | PHP | Personal | Your IP: 38.103.63.18 |
|
Tutorials: ASP COM Links: |
Steps for building our component: 2
Note: We are not building a Microsoft Transaction Server® (MTS) aware component nor a Application level component. We are building a page level component, which means that it will be instantiated when a ASP page starts executing and will be destroyed when it finishes executing. Hence, we require the OnStartPage/OnEndPage methods. Whenever a ASP page starts executing and calls a COM component, the OnStartPage method inside the component is called. When the ASP page finishes executing the OnEndPage method is called. Any resources allocated in the OnStartPage method should be released in the OnEndPage method. Typically the pointers to the built-in ASP objects are retrieved in the OnStartPage and are released in the OnEndPage. Examine the code that the ATL Object Wizard has added. You will see that the code for acquiring and releasing the built-in (or intrinsic) ASP objects in these methods has been already added for you. (In our example, see the file ProcessForm.cpp which is part of the download.)
From the Workspace Window select the Class View tab. Expand each node and see the
new classes and interfaces that have been added by the ATL Object Wizard. Look at the method: STDMETHODIMP CProcessForm::OnStartPage (IUnknown* pUnk) Had this been a MTS aware component we would get the ObjectContext instead of the Scripting Context to access the intrinsic ASP objects. There would be some other changes to the code too. But more about it in later tutorials. Now we will implement two mehods for processing FORM submissions. One method called FormGET(...) for HTML forms posted with GET method and the other called FormPOST(...) for forms posted with POST method.
|
| Home | Java | Palm OS | ASP COM | XML XSL | PHP | Personal | Contact |