Detta är min ActiveX DLL: Titta på denna kursen så ser du hur man gör: Kan göra det på lite olika sätt. <br>problem med min DLL
<code>
Function InkData(ByVal strdata As String)
Data1 = "test1" & strdata
Data2 = "test2" & strdata
Data3 = "test3" & strdata
Data4 = "test4" & strdata
End Function
</code>
Hur gör jag för att hämta ut Data1 från min asp sida?
<code>
<%=opning.InkData(Data1)%> ???
</code>Sv: problem med min DLL
http://www.pellesoft.nu/login/articles/asp/asp_firstcomponent.asp
/JohanSv: problem med min DLL
<br>
Alternativ1:
<code>
Option Explicit
Private mData1 As String
Private mData2 As String
Private mData3 As String
Private mData4 As String
Function InkData(ByVal strdata As String)
mData1 = "test1" & strdata
mData2 = "test2" & strdata
mData3 = "test3" & strdata
mData4 = "test4" & strdata
End Function
Public Property Get Data1() As String
Data1 = mData1
End Property
Public Property Get Data2() As String
Data2 = mData2
End Property
Public Property Get Data3() As String
Data3 = mData3
End Property
Public Property Get Data4() As String
Data4 = mData4
End Property
'ASP
<%
Set opning = Server.CreateObject("Dll.Class")
opning.InkData("Mitt värde")
Data1 = opning.Data1
Data2 = opning.Data2
Data3 = opning.Data3
Data4 = opning.Data4
%>
</code>
<br>
<br>
Alternativ2:
<code>
Option Explicit
Private mData(1 To 4) As String
Function InkData(ByVal strdata As String)
mData(1) = "test1" & strdata
mData(2) = "test2" & strdata
mData(3) = "test3" & strdata
mData(4) = "test4" & strdata
End Function
Public Property Get Data(ByVal Index as Long) As String
Data = mData(Index)
End Property
'ASP
<%
Set opning = Server.CreateObject("Dll.Class")
opning.InkData("Mitt värde")
Data1 = opning.Data(1)
Data2 = opning.Data(2)
Data3 = opning.Data(3)
Data4 = opning.Data(4)
%>
</code>