Share via


IIS Samples - Component that Accesses ASP Intrinsic Objects

This is the ATL (ActiveX Template Library) version of the Power sample object for Active Server Pages. It demonstrates how to write a component that makes use of the intrinsic ASP objects.

Look at CATLPwr.idl, Power.h, and Power.cpp to see how these methods and properties are declared and implemented.

As this example is merely a template, demonstrating the required functions, there is no installation or sample output information.

important Important These samples are provided for educational purposes only. They are not intended to be used in a production environment, have not been tested in a production environment, and Microsoft does not provide technical support for them.

Requirements
Location of the Source Code
Build the Sample
Helpdesk

Requirements

This sample requires the installation of the following software to function properly:

  • Windows XP Professional with IIS 5.1 installed or Windows .NET Server with IIS 6.0 installed.
to top

Location of the Source Code

IIS samples are included in the IIS Software Developer Kit (SDK). You can download the IIS SDK from Platform SDK Update. You can view the SDK at MSDN Online. In the table of contents at MSDN Online, click Web Development, Server Technologies, Internet Information Services (IIS), SDK Documentation, Internet Information Services, Samples.

The following source code files are required for this sample:

File Description
CAtlPwr.sln CAtlPwr Visual Studio .NET solution file, required to build this sample in Visual Studio .NET.
CAtlPwr.vcproj CAtlPwr Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET.
CAtlPwr.dsp, CAtlPwr.dsw CAtlPwr Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6.
CAtlPwr.cpp, power.cpp, context.cpp, stdafx.cpp CAtlPwr source modules containing the code that implements the sample.
CAtlPwr.def, powerps.def CAtlPwr.dll definition containing code for creating the sample.
CAtlPwr.h, power.h, stdafx.h CAtlPwr header file containing commonly called routines.
CAtlPwr.mak, powerps.mak CAtlPwr makefile for command line compilation
CAtlPwr.asp CAtlPwr ASP Page, demonstrating use of this sample
to top

Build and Install the Sample

To build this sample using the Visual C++ IDE, the following steps must be performed:

  1. Open the solution (VS.NET) or desktop (VS6) file to open the project.
  2. Click Build to create the DLL.

To build and run this sample without using the Visual C++ IDE, the following steps must be performed:

  1. Type NMAKE All from the command line. For example, if your sample files are located in a folder called C:\MySamples, type the following at the command line:
    cd /d c:\MySamples
    NMAKE All
    

Help Desk

If here you do not find answers to your questions, visit the Microsoft Help and Support Web site.

Problem Possible Solution
When browsing to the ASP page, IE returns HTTP 404 - File not found Verify that you have created a virtual directory of the same name you are typing in the Address box of IE....
When building the dll, C++ or VB returns the a permissions error. Once you have called the dll from your web page, your system considers it a loaded dll. You must unload it to build it again, either by unloading the ASP application or deleting the dll from system32\dllcache.
When building the dll, C++ returns a permissions error. Once you have called the dll from your web page, your system considers it a loaded dll. You must unload it to build it again, either by unloading the ASP application or deleting the dll from system32\dllcache.
When browsing to the dll, IE gives you a permissions error. The folder and virtual directory must have Execute permissions set on them.
to top