Results 1 to 14 of 14

Thread: Creating a component....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    Hi,
    Im trying to develop a component in VB to be used with ASP. Im done compiling the VB project into a dll. But Im stuck here. Is all I have to do next register my dll? If so, thats got to be done on the server right? which happens to be NT. So do i register it using regsvr32???

    Thanx a ton.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    the dll is registered automatically when you build (make) the dll file (file->make).

    to use it in script, you
    var objTest = Server.CreateObject ("YourPrjectName.YourClassName")
    and then you can:
    objTest.Method()

    you can also debug it, by running it (F5) on vb,
    putting a breakpoint somewhere (F9),
    and then call to the asp page using a browser.

    try it.
    itay.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    thanx itay...but a teeny clarification....

    the asp files are stored on a server....im working on another system(where ive created the dll) ...so wont i have to place the dll on the server and register it there????

    tried that already but am getting am error

    "Server object error 'ASP 0177 : 800401f3'

    Server.CreateObject Failed

    Invalid class string "

    any idea??


    [Edited by rammy on 01-11-2001 at 06:27 AM]

  4. #4
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    oops...
    i assumed the web server and the development machine is the same one.

    yes, you need to register the dll on the server.
    this is very easy.
    just put the file on the server (anywhere you want, but i'd use a special folder)
    registeration can be done using RegSrv32, but you can just
    double click the dll.

    the rest is the same.
    ---
    important tip:
    as you keep programing dlls, you might have newer versions of the same dll.
    so keep one rule in mind, to avoid complication (after all, registration is putting data in the registry, yuo don't want to mess that).
    the rule is:
    before deleteing a dll, UNregister it (right click on it and select unregister).
    ----

    goodluck
    itay.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Smile

    thanx a ton itay! will try it.....


  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Red face its not quite working....

    well, for one right clicking doesnt have an unregister option. any ideas??

    Thanx

  7. #7
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    invalid class string error suggests that the "ProjectName.ClassName" parameter is wrong (on the Server.CreateObject method).
    maybe it's because you never registered the dll.

    i don't know why right clicking doesn't give you the register/unresiter option.
    are you sure you doing it on the dll file?

    anyhow, to use regsvr:
    regsvr32 FILENAME.DLL
    or with /u to unregsiter
    regsvr32 /u FILENAME.dll.

    still stuck?

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Smile

    thanx itay! once again...will try it out....

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Unhappy itay..........

    itay.....

    have managed to get my asp file running....but Im stuck with
    another problem....when I make any changes to the dll file and then try to replace the old dll file existing on the server, I get an error message saying "Cannot delete file. The source or destination files may be in use" ...but Ive
    unregistered the old dll before trying to delete it. Any ideas??? as of now Im getting my work done my placing multiple copies...in different folders and then working....

    Thanx a ton.

  10. #10
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi rammy

    With NT, to make any changes to a dll once it has been registered and used, you have to restart NT. also it is wise to shut down the web-site that accesses it before re-starting.
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  11. #11
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    and unless your dll is binary compatable, you need to re-register it each time you change it as well

    hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Smile

    Is re-starting the server the only way out??? coz Im not sure that I can do that. Thanx a lot anyway, Ianpbaker.

    Rammy.

  13. #13
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    unfortunatley with nt4, there is no other way of doing it that I know of.

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298

    Smile

    okie, thanx

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