I want to use a user defined class in VB with ASP?
iassen | Posted 7:38am 9. October 2002 Server Time |
Hello guys,
I am trying to get the hang of this here. If I have an ASP script running, can I have that ASP script instanciate a class I have defined using VB? And if so, how do I do that?
Thanks for your time and help,
Regards,
Iassen Ivanov |
iassen | Posted 8:30am 9. October 2002 Server Time |
Now when I am thinking about it, I guess I am trying to include the cls file that I have. Is there a way for that and/or is there a better way?
Thanx,
Iassen
Holly | Posted 8:40am 9. October 2002 Server Time |
If your class has been compiled into a .dll (VB component) and registered on the server where your web application resides, you instantiate it like this (on the server side, of course):
dim objMyObject
set objMyObject = Server.CreateObject("ComponentName.ClassName")
You now have an instance of the class in your asp, so you can access its methods and properties.
iassen | Posted 8:49am 9. October 2002 Server Time |
Ok, how do I register it on the server?
iassen | Posted 10:22am 9. October 2002 Server Time |
I guess I needed to read some documentation on how to create an Active X DLL:) if it hurt as much as i am lazy i would have been dead by now...
Thanx,
iassen
Holly | Posted 11:35am 9. October 2002 Server Time |
After you compile the .dll, put it into a directory on your server. You can compile it to that directory or move/copy it using Windows Explorer. After you do that, click the Start button on your menu bar, click Run, and type in regsvr32.exe followed by the path to the .dll, like this:
regsvr32.exe c:\MyDirectory\MyDll.dll
Click OK and if all goes well you'll get a message that the registration succeeded.
iassen | Posted 5:51am 16. October 2002 Server Time |
Ok,
The above shows me how to register a dll. How do I unregister one so that I can replace it, update it or whatever else I want to do with it? The reason I am asking is because I can't even replace the dll file with an updated version. Tells me there is a sharing violation.
Thanx,
Iassen
iassen | Posted 5:54am 16. October 2002 Server Time |
Let me answer my question:)
It's amazing how most of those answers are out there and I just have to go and find them. Lazy, Lazy, Lazy...
so here it is:
regsvr32.exe /u c:\mydir\mydll.dll
iassen | Posted 5:57am 16. October 2002 Server Time |
Still can't delete the file though???? I hate....let me stop here.
So does anybody know what do I need to do?
Reply to Post I want to use a user defined class in VB with ASP?
|
|
|