eduardoquiroz
New member
- Joined
- Jun 17, 2010
- Messages
- 1
- Programming Experience
- Beginner
Hello everyone.
I'm having a trouble with a function from a class and I need some help.
I've just 1 webpage and 1 vb file. In the vb file I have something like this:
And I have my web page with something like this:
And I'm having the following error :
"Specified cast is not valid"
What I'm doin' wrong?
Thanks in advance
I'm having a trouble with a function from a class and I need some help.
I've just 1 webpage and 1 vb file. In the vb file I have something like this:
VB.NET:
Public Class myclass
Inherits System.Web.UI.Page
<System.Runtime.InteropServices.DllImport("somelib.dll")> _
Public Shared Function function1(ByVal par1 As System.IntPtr, _
ByVal par2 As Integer) As Long
End Function
End Class
VB.NET:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="myclass.vb" Inherits="myclass" Debug="true"%>
<%
Dim a As New myclass
Dim DataIn
Dim DataOut
DataIn = "some text of in"
DataOut = ""
Try
a.function1(DataIn, DataOut)
Catch ex As Exception
Response.Write("ERROR=" & ex.Message)
End Try
Response.Write("<br>TEST=" & DataOut)
%>
"Specified cast is not valid"
What I'm doin' wrong?
Thanks in advance
Last edited by a moderator: