This sample demonstrates how to use the required functions of every ISAPI extension. When learning ISAPI, this is a good place to start.
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.
Sample Overview
Requirements
Location of the Source Code
Build and Install the Sample
Run the Sample
Sample Output
Helpdesk
Every ISAPI extension needs to implement three functions so that IIS can use it properly. The GetExtensionVersion function should use the version structure provided by IIS to set the ISAPI architectural version number of this extension. The HttpExtensionProc function processes the request and outputs the appropriate response to the web client using WriteClient(). The TerminateExtension function is called when the WWW service is shutdown and typically contains cleanup code. More information is contained in the source files for the sample.
to top
This sample requires the installation of the following software to function properly:
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 |
---|---|
Simple.sln | Simple Visual Studio .NET solution file, required to build this sample in Visual Studio .NET. |
Simple.vcproj | Simple Visual Studio .NET C Project file, required to build this sample in Visual Studio .NET. |
Simple.dsp, Simple.dsw | Simple Visual Studio 6.0 project files, required to build this sample in Visual Studio Version 6. |
Simple.cpp | Simple source modules containing the code that implements the sample. |
Simple.def | Simple.dll definition containing code for creating the sample. |
MAKEFILE | Simple makefile for command line compilation |
Run.htm | Simple Web file, required to illustrate how the sample file is used. |
To build this sample using the Visual C++ IDE, the following steps must be performed:
To build and run this sample without using the Visual C++ IDE, the following steps must be performed:
C:\MySamples
, type the following at the command line:
cd /d c:\MySamples NMAKE All
To install this sample, the following steps must be performed:
C:\Samples
and copy the files to that folder.inetmgr
in the text box and click OK. Right-click on the Web
site where you want to create a virtual directory, click New, and click Virtual
Directory. In the Alias text box, type the name you want for your virtual directory, for
example, Simple
. In the Directory text box, type the path to the
folder that contains your files.
In order to run this sample, follow the instructions listed below:
Simple
, type
http://localhost/Simple/Run.htm
in the Address bar
of IE.
The following output is displayed somewhere after you perform step 1 from Run the Sample:
Simple ISAPI Extension Copy the Simple.dll into the same directory as this html file. Then click here.
After you click Then click here
, the following is displayed:
Hello from Simple ISAPI Extension DLL!to top
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 HTM 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++ 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. |
© 1997-2002 Microsoft Corporation. All rights reserved.