Calling DLL Function Inside Classic ASP
Calling DLL Function Inside Classic ASP
Post +
home > topics > asp / active server pages > questions > calling dll function inside classic asp
Join Bytes to post your question to a community of 472,081 software developers and data experts.
Hello,
I need to call .net dll function inside of classic asp.
So i regsitered dll and tlb file with regasm.exe (and /codebase parameter). there is no problem.
There is a sql databse and some table have image type data (inside has picture data). I want to send image data to dll function like a image or byte() type.
Set jpg = Server.CreateObject("ad_jpeg.Jpeg")
jpg.openBinary(rs("prev")) 'prev is sql 2008 image type
my .net dll function
=========================================================
Public Function openBinary(ByVal gln As Object) As ;Boolean
If gln Is Nothing Then
lastError = "No binary data"
Return False
Else
Try
Dim img As Image
Dim ms = New MemoryStream(CType(gln, Byte()))
img = Image.FromStream(ms)
If img IsNot Nothing Then
jpeg = img
Return True
Else
lastError = "Incoming data error"
Return False
End If
Catch ex As Exception
lastError = "Incoming type of data : " & gln.GetType().ToString & vbCrLf & ex.ToStrin
Return False
End Try
End If
Dec 25 '14 #1
✓ answered by adincergok
I've solved myself successfully (I've try all data types)...
My code here:
=====================================
Public Function openBinary(ByVal gln As String) As Boolean
If String.IsNullOrEmpty(gln) Then
lastError = "No binary data"
Return False
Else
Try
Dim array() As Byte = System.Text.Encoding.Unicode.GetBytes(gln)
Dim img As Image
Dim ms = New MemoryStream(array)
img = Image.FromStream(ms)
If img IsNot Nothing Then
jpeg = img
Return True
Else
lastError = "Incoming data error"
Return False
End If
Catch ex As Exception
lastError = "Incoming type of data : " & gln.GetType().ToString & vbCrLf & ex.ToStr
Return False
End Try
End If
End Function
1 3994
Tchibo Black 'N White 10'lu Tchibo Espresso Vanilya Tchibo Matara Taşıma Tchibo Caffè Crema Rich Tchibo Ofis Malzemeleri
Kapsül Kahve 10'lu Kapsül Kahve Çantası, Lacivert Aroma 10'lu Kapsül Kahve Dosyası
adincergok
3
My code here:
=====================================
Public Function openBinary(ByVal gln As String) As Boolean
If String.IsNullOrEmpty(gln) Then
lastError = "No binary data"
Return False
Else
Try
Dim array() As Byte = System.Text.Encoding.Unicode.GetBytes(gln)
Dim img As Image
Dim ms = New MemoryStream(array)
img = Image.FromStream(ms)
If img IsNot Nothing Then
jpeg = img
Return True
Else
lastError = "Incoming data error"
Return False
End If
Catch ex As Exception
lastError = "Incoming type of data : " & gln.GetType().ToString & vbCrLf & ex.ToString
Return False
End Try
End If
End Function
Dec 25 '14 #2
reply
Post Reply
Similar topics
Calling a function inside another function doesn't seem to work anymore with mysqli PHP
1 post views Thread by guy13 | last post: by
create a game with ps3 style graphics by myself, is it possible? how can I do it? General
reply views Thread by BenitoJuares | last post: by
How do we call a function with parameters and use output returning true/false in php? PHP
reply views Thread by bakertaylor28 | last post: by
Forrester: Four Digital Intelligence Products of AsiaInfo Included in China Data Governance Ecology Report General
reply views Thread by antdb | last post: by
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.
BYTES.COM © 2023
About Bytes
Advertise Follow us! Get the Latest Bytes Updates
Terms Of Use
Privacy Policy
Contact Us
Sitemap