473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Create a DLL with VB.NET to use it in ASP pages

Hi, I have to make a DLL in Visual Studio using VB.NET, then I have to
use it on a web application in ASP.
This is my class:

--------------------------------------------------------
Imports System
Imports System.Net
Imports System.IO
Imports System.Text
Imports System.Xml
Imports System.DirectoryServices

Public Class libConnessioni

Private strUserName, strPassword, strDomain As String

Public Function LDAPgetAllEmails(ByVal domain As String) As String
[...]
End Function

Public Function LDAPgetEmail(ByVal domain As String, ByVal user as
string) As String
[...]
End Function

Public Function WEBDAVgetAllEmails(ByVal uri As String) As String
[...]
End Function

Public Function WEBDAVgetEmail(ByVal uri As String, ByVal user as
string) As String
[...]
End Function

End Class
--------------------------------------------------------
I've generated a DLL, with the name of the project
("testConnessione.dll") but when I try to use it on my http://localhost/test.asp
page, in this way:
--------------------------------------------------------
<%@ Language=VBScript %>
<% Option Explicit %>
<html>
<body>
<%
set objWebDav=server.CreateObject("testConnessione.lib Connessioni")
dim s
s = objWebDav.LDAPgetAllEmails("")
response.write (s)
%>
</body>
</html>
--------------------------------------------------------

I get a message that told me tha I don't have authorization to use
server.createobject...

On the server I've registered it with regasm.exe but when I try to run
this test page on the web server I got this error on the line of the
server creatobject call:

error '80070002'

Can you help me?

bye
Giulio

Mar 16 '07 #1
4 1497
po**@rockit.it wrote in news:1174035397.153893.181580
@e65g2000hsc.googlegroups.com:
<%@ Language=VBScript %>
<% Option Explicit %>
<html>
<body>
<%
set objWebDav=server.CreateObject("testConnessione.lib Connessioni")
dim s
s = objWebDav.LDAPgetAllEmails("")
response.write (s)
%>
</body>
</html>
--------------------------------------------------------

I get a message that told me tha I don't have authorization to use
server.createobject...
Did you register the DLL with RegSvr32? Also if you need to access the DLL
via COM you need to add a bunch of attributes (such as ComClass Attribute).
Mar 16 '07 #2
Did you register the DLL with RegSvr32? Also if you need to access the DLL
via COM you need to add a bunch of attributes (such as ComClass Attribute).

When I register the class I receive the messagge:

......dll was loaded, but no starting point DllRegisterServer was
found.

this file cannot be registered.

Or something like this, since I've translated it from italian.
How can I add those ComClass Attribute?

Thank you.
Giulio
Mar 16 '07 #3
On 16 Mar 2007 01:56:37 -0700, po**@rockit.it wrote:
Hi, I have to make a DLL in Visual Studio using VB.NET, then I have to
use it on a web application in ASP.
This is my class:

--------------------------------------------------------
Imports System
Imports System.Net
Imports System.IO
Imports System.Text
Imports System.Xml
Imports System.DirectoryServices

Public Class libConnessioni

Private strUserName, strPassword, strDomain As String

Public Function LDAPgetAllEmails(ByVal domain As String) As String
[...]
End Function

Public Function LDAPgetEmail(ByVal domain As String, ByVal user as
string) As String
[...]
End Function

Public Function WEBDAVgetAllEmails(ByVal uri As String) As String
[...]
End Function

Public Function WEBDAVgetEmail(ByVal uri As String, ByVal user as
string) As String
[...]
End Function

End Class
--------------------------------------------------------

I've generated a DLL, with the name of the project
("testConnessione.dll") but when I try to use it on my http://localhost/test.asp
page, in this way:

--------------------------------------------------------
<%@ Language=VBScript %>
<% Option Explicit %>
<html>
<body>
<%
set objWebDav=server.CreateObject("testConnessione.lib Connessioni")
dim s
s = objWebDav.LDAPgetAllEmails("")
response.write (s)
%>
</body>
</html>
--------------------------------------------------------

I get a message that told me tha I don't have authorization to use
server.createobject...

On the server I've registered it with regasm.exe but when I try to run
this test page on the web server I got this error on the line of the
server creatobject call:

error '80070002'

Can you help me?

bye
Giulio
You need to do a bit of work to get your component to be visible by COM,
because there are a number of things you need to implement for COM
components. Read the following link in MSDN 2005 help for more details

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vbalr/html/7b07a463-bc72-4392-9ba0-9dfcb697a44f.htm
--
Bits.Bytes
http://bytes.thinkersroom.com
Mar 16 '07 #4

..Net COM dll`s need to be registred with REGASM not with Regsvr32

creating a com class is not so difficult
here is a real life example of mine

http://groups.google.nl/group/micros...996d74d250974e

important :
remember to add a parameterless constructor to your class

regards

Michel posseth

"Spam Catcher" <sp**********@rogers.comschreef in bericht
news:Xn**********************************@127.0.0. 1...
po**@rockit.it wrote in news:1174035397.153893.181580
@e65g2000hsc.googlegroups.com:
><%@ Language=VBScript %>
<% Option Explicit %>
<html>
<body>
<%
set objWebDav=server.CreateObject("testConnessione.lib Connessioni")
dim s
s = objWebDav.LDAPgetAllEmails("")
response.write (s)
%>
</body>
</html>
--------------------------------------------------------

I get a message that told me tha I don't have authorization to use
server.createobject...

Did you register the DLL with RegSvr32? Also if you need to access the DLL
via COM you need to add a bunch of attributes (such as ComClass
Attribute).

Mar 17 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Noyb | last post by:
Is it possible to create a php page dynaimically? For example, when a user is added I'd like to create a page in a directory in their name so users could go to www.mysite.com/jack or...
7
by: Dennis | last post by:
I am very new to PHP, although I have been using ASP for a few years. I use a product in ASP called ASPTear, it's a small dll that my hosting company happens to have loaded. Basically you can...
2
by: Creat ASP Page Automatic | last post by:
Hi; I want to ask you something very important for me .. how can i Create daynamic pages or static pages Automatic .??????????!!! i have a problem with my website i want Create page asp...
14
by: Dafydd | last post by:
I have the following Script in my web page reduce to two pages. <script> function details() { document.getElementById('details').style.visibility='visible';...
4
by: ferg | last post by:
I've checked all the FAQs and help - spent a couple of hours on this now and it's really bugging me. I've got Moin 1.3.5 installed on IIS 5.0. I can view and edit pages without any problems, but...
0
by: ghadley_00 | last post by:
MS Access Create form / report with multiple pages using different background images Hi, Would like to have users fill out a multipage form, and then click a print button, which pulls up the...
17
by: Jeffrey W. Baker | last post by:
Greetings, I have a 23GB data table upon which I am building a primary key of three columns. The data is mounted in a 137GB device and pg_xlog is mounted on a separate 3.5GB device. I have...
3
by: Madhu | last post by:
All, New to DB2 environment. Can someone share a script that can be used to a create a DB2 UDB database manually. I am trying to create a database on Linux, single partition. Thanks Madhu
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.