Article ID: 239445 - Last Review: July 2, 2004 - Revision: 3.3 How To Obtain ObjectContext with ObjectControl Inside Visual C++ COM DLL from ASP and MTS
This article was previously published under Q239445 SUMMARY
This article covers the implementation of the Microsoft Transaction Server (MTS) ObjectContext object through the ObjectControl object inside a Visual C++ component under MTS control for Active Server Pages (ASP). This implementation is extremely useful if you would like to have direct access to the ASP intrinsic objects (for example, Application, Session, Response, Request, Server). Visual C++ provides the Active Template Library (ATL) to assist you in developing COM components. Using the ATL COM AppWizard you can very quickly create the basic framework of your component. For example, the AppWizard generates all of the code that is necessary for exposing your component as a dual interface. In addition, ATL provides a wizard for adding objects to an ATL application. The ATL Object Wizard supports both methods of accessing the ASP built-in objects. If you want your component to use the page-level event methods (OnStartPage and OnEndPage) to access the built-in objects, you should pick ActiveX Server Component as the type from the wizard's opening screen. If you want your component to use the IObjectContext interface to access the built-in objects, you should choose Microsoft Transaction Server from the initial screen. You should now use the ObjectContext object to access the built-in objects. ObjectContext makes Internet Information Server (IIS) applications better suited for large-scale scenarios and provides support for transaction processing. It is highly recommended that you convert your existing ASP-based applications to this new approach if they are high-volume applications. This conversion is required if your applications support transaction processing. In the following sample you take advantage of an existing class that was distributed with one of the Visual C++ samples as part of the Windows NT 4.0 Option Pack IIS SDK Documentation. The IIS Software Developer Kit programmer documentation and samples portion of the Windows NT 4.0 Option Pack must first be installed before you can complete steps in this article. These files are available in the ...\Iissamples\Sdk\Components\C++\Intermediate subdirectory of the Internet services directory. MORE INFORMATION
REFERENCES
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
