Click to See Complete Forum and Search --> : Creating a component....
rammy
Jan 11th, 2001, 05:05 AM
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.
itay222
Jan 11th, 2001, 05:10 AM
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.
rammy
Jan 11th, 2001, 05:15 AM
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]
itay222
Jan 11th, 2001, 05:25 AM
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.
rammy
Jan 11th, 2001, 05:30 AM
thanx a ton itay! will try it.....
rammy
Jan 11th, 2001, 05:38 AM
well, for one right clicking doesnt have an unregister option. any ideas??
Thanx
itay222
Jan 11th, 2001, 05:44 AM
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?
rammy
Jan 11th, 2001, 05:47 AM
thanx itay! once again...will try it out....
rammy
Jan 16th, 2001, 04:35 AM
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.
Ianpbaker
Jan 16th, 2001, 05:08 AM
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.
Ianpbaker
Jan 16th, 2001, 05:10 AM
and unless your dll is binary compatable, you need to re-register it each time you change it as well
hope this helps
Ian
rammy
Jan 16th, 2001, 05:29 AM
Is re-starting the server the only way out??? coz Im not sure that I can do that. Thanx a lot anyway, Ianpbaker.
Rammy.
Ianpbaker
Jan 16th, 2001, 05:59 AM
unfortunatley with nt4, there is no other way of doing it that I know of.
Ian
rammy
Jan 16th, 2001, 06:01 AM
okie, thanx
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.