Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: COM/DCOM/COM+
Expertise: Beginner
Oct 21, 1999

Reference a DLL From an ASP Page

Question:

I wrote a DLL in Visual Basic and I want to use its functions in ASP. I created a server.CreateObject("projectname.classname") and tried to call some of the methods of the object, but received "Automation error Invalid syntax." How do I use the object's methods?

Answer:

Once you create the DLL in VB, you need to copy it to the Web server machine and then register it. Use the utility RegSvr32.EXE found in your Windows directory to register your DLL.

RegSvr32 will register a DLL.
RegSvr32 /U will unregister a DLL.

Once you do that, you can access it by using the code you have:

set objSomething = Server.CreateObject("projectname.classname")

Then call its method (say MethodCall) by using:

objSomething.Methodcall

Finally, remove the object from memory:

set objSomething = Nothing
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date