Results 1 to 2 of 2

Thread: DLLs, Functions & ASP

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    70

    Question

    I want to create a dll with public functions to be used in
    ASP pages. Similar to the way regular vbscript functions are used. Ie. Date1 = FormatDateTime(Date2, 2)

    I would like to create my own function -- for example,
    FormatString -- and call it from an ASP page.
    To avoid the obvious question: I want to use VB not VBscript and I want it to be compiled code (in hopes of having it run faster).

    I've been trying but to no avail.

    Thanks in advance

  2. #2
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Create an ActiveX dll with your function as a public method of a class within.

    On the web server:
    Register the DLL

    On the web page:
    Dim an object variable
    Set a reference to your dll
    call it's methods and use it's properties.

    Code:
    Dim objMyDLL
    Dim strBlah
    
    Set objMyDLL = Server.CreateObject("MyDLL.MyClass")
    
    strBlah = objMyDLL.MyFunction(strBlah)
    
    'Clean up when done...
    Set objMyDLL = Nothing
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width