Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / October 2005



Tip: Looking for answers? Try searching our database.

Calling a VB DLL from ASP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leo - 18 Oct 2005 20:06 GMT
I asked this question in the ASP forum, but they only helped to  a point.
aso here i am asking it on the vb forum

my problem is this:

I have written a VB wrapper DLL that calls a C++ DLL. I then call tgis VB
DLL from an asp page, pass it two strings, then get back an encrypted string
out of the two I pass it. The issue is that when I am on the VB IDE and I
run the DLL then call it from ASP it works beautifully. However when I
compile the VB project into a DLL and register it, then run my asp page,
nothing happens. The DLL doesn't get called. It returns no error, no
nothing. It just gives me a blank page (instead of the encrypted string it
should give me)

Can anyone shed some light on this issue please?

Here's my code for the VB DLL:

Private Declare Function DmfDemoEncrypt Lib "email_encrypt.dll" (ByVal email
As String, ByVal s As String) As String

Public Function EncryptData(ByVal emailaddresses As String, ByVal
DataToEncrypt As String) As String

Dim strEmails As String
Dim strEncryptThisString As String
Dim strEncryptedData As String

           strEncryptThisString = DataToEncrypt
           strEmails = emailaddresses
           strEncryptedData = (DmfDemoEncrypt(strEmails,
strEncryptThisString))

           EncryptData = strEncryptedData

End Function

and the ASP code

<%

Dim WshShell,fso,cd,objRSServer,strEmails,strAll, strRetString

Set objRSServer = CreateObject("encrypt.clsEncryptData")

       strEmails = leo@email.com,paul@email.com
       cd = "this is encrypted email test"

 on error resume next

'this is where the encryption happens. DLL is called and strAll now contains
an encrypted string
strAll=objRSServer.EncryptData(strEmails, cd)

   if err<>"" then
   response.write Err.number & " " & err.description
   end if

response.write("<td>")

response.write "<TEXTAREA name='thetext' rows='50' cols='100'>"

response.write strAll
response.write("</TEXTAREA>")
response.write("</td>")

%>

Please help.....with whatever you can. No matter how crazy the idea just
post it. I am desperate
Someone - 18 Oct 2005 21:52 GMT
>  on error resume next

This would hide subsequent errors. After you find that the line you suspect
the error was successful, use "On Error Goto 0" so you can see subsequent
errors.

>    if err<>"" then
>    response.write Err.number & " " & err.description
>    end if

The default property for Err object is Number. The above code segment may
not show anything. Use "If Err.Number <> 0 Then"

>        strEmails = leo@email.com,paul@email.com

There are no double quotes around the emails. "on error resume next" above
hides this problem.

You could also make your function return a fixed text for testing, like
"Hello". If email_encrypt.dll is not on the same folder as your DLL, you get
a runtime error and that makes debugging more difficult.

>I asked this question in the ASP forum, but they only helped to  a point.
> aso here i am asking it on the vb forum
[quoted text clipped - 69 lines]
> Please help.....with whatever you can. No matter how crazy the idea just
> post it. I am desperate
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.