Home Tutorials IT Jobs Source Codes Certifications Discussion Forum
  Python Tutorials
Introduction
ASP - Setup
ASP - Running
ASP - First Script
Syntax
ASP - VBScript
ASP - Javascript
ASP - Operators
If Statement
Select
Variable
Array
Session
Cookies
String
Forms
Forms Get
Forms Post
Email Form
ASP Object
ASP Components
ASP Comments
Special Characters
DLL
ADO
ASP File
ASP Date
   IT Jobs
Software Jobs
Networking Jobs
   Model Question Papers
BE Computer Science
MCA
BCA
Others
 
   

ASP DLL Information

When creating or using complex ASP web applications you will surely run into one that requires the use of a DLL. The DLL usually includes code that was compiled in VB, C++, or other Windows programming languages to be used in the ASP application.

Registering a DLL

Before you can start using the code that resides in the DLL file, you must first register the DLL with the windows runtime library. There are two ways to let windows know about this new DLL.

  • Save the DLL to C:\Windows\system32\ 
    or
  • Manually register it with the regsvr32 application

The first option is self-explanatory, but the second option takes a bit more work. Here is a quick How-To on registering DLLs:

  • Find out the location of your DLL. We will be using C:\Inetpub\wwwroot\codetellerASP\myDLL.dll in this example.
  • Click on the Start menu and choose Run
  • Type in regsvr32.exe "C:\Inetpub\wwwroot\codetellerASP\myDLL.dll" (With the quotes)
  • You should get a confirmation message if it succeeded, such as: "DllRegisterServer in C:\Inetpub\wwwroot\codetellerASP\myDLL.dll succeeded"

Using Your DLL in ASP

Now that you have registered your DLL you need to learn how to access the functions that are contained within it. Let us assume for the sake of this example that the DLL file is called "myDLL.dll" and the name of the class is "myClass".

To create an instance of this class you would use the Server.CreateObject method like so:

ASP Code:

<%
'Note this is example code, it will not work 
' unless you create a myDLL, myClass, and a myMethod
Dim myObject
myObject = Server.CreateObject("myDLL.myClass")
myObject.myMethod("something")
myObject = nothing
%>


<< Previous | Next >>

Home  |  About us  | Privacy  |  Disclaimer  |  Contact us |  Advertise with us | Our Link Partners
All Rights Reserved 2009, CodeTeller.com