dll help

Discussion in 'ASP General' started by Savas Ates, Jul 27, 2004.

  1. Savas Ates

    Savas Ates Guest

    i wrote this class in VB


    Public Function toplama(x, y)
    z = x + y
    toplama = z

    End Function

    ***********class name= toplama************ and projectname= project1

    from file--> make dll and occurred ilim.dll

    run cmd regsvr32 ilim.dll i typed and it was registered..(succesfully)


    in my asp page

    <%
    Set objName = Server.CreateObject("Project1.toplama")
    objName.toplama x,y

    objName.x=10
    objName.y=10
    response.write objName

    %>

    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'objName.x'
    /app/dll.asp, line 5


    what is the wrong help me. this the first time i use a dll and i think i
    have some mistakes..
    Savas Ates, Jul 27, 2004
    #1
    1. Advertising

  2. Savas Ates

    CJM Guest

    "Savas Ates" <> wrote in message
    news:...
    > i wrote this class in VB
    >
    >
    > Public Function toplama(x, y)
    > z = x + y
    > toplama = z
    >
    > End Function
    >
    > ***********class name= toplama************ and projectname= project1
    >
    > from file--> make dll and occurred ilim.dll
    >
    > run cmd regsvr32 ilim.dll i typed and it was registered..(succesfully)
    >
    >
    > in my asp page
    >
    > <%
    > Set objName = Server.CreateObject("Project1.toplama")
    > objName.toplama x,y
    >
    > objName.x=10
    > objName.y=10
    > response.write objName
    >
    > %>
    >
    > Error Type:
    > Microsoft VBScript runtime (0x800A01B6)
    > Object doesn't support this property or method: 'objName.x'
    > /app/dll.asp, line 5
    >
    >
    > what is the wrong help me. this the first time i use a dll and i think i
    > have some mistakes..
    >
    >


    The error message hits the nail on the head - the object has no property
    called 'x'.

    Your code should read something like this:

    Set objName = Server.CreateObject("Project1.toplama")
    Response.Write objName.toplama(10,10)

    Or a longer version:

    Set objName = Server.CreateObject("Project1.toplama")
    x=10
    y=10
    z=objName.toplama(x,y)
    Response.Write z


    hth

    Chris
    CJM, Jul 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,690
  2. Weston Fryatt
    Replies:
    2
    Views:
    961
    Weston Fryatt
    Jan 1, 2005
  3. NGM
    Replies:
    0
    Views:
    2,302
  4. wpy
    Replies:
    1
    Views:
    367
    -=Chris=-
    Nov 11, 2003
  5. H. Simpson
    Replies:
    4
    Views:
    258
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page