entrypointnotfound error although a DLL is referenced

  • Thread starter Thread starter rmcbeth
  • Start date Start date
R

rmcbeth

I'm working in Visual Basic.net and I'm new to creating DLLs. I ran
into a problem creating a simple DLL. I used this newsgroup to try and
figure out what was wrong and I'm still stuck with an
entrypointnotfound error. What do I need to do to make this simple
subroutine call work?

This is the code for the DLL:
<CODE>
Public Class returnNumber
Public Sub Encode_L10()
MsgBox("Returns a 10")
End Sub
End Class
</CODE>

This is the code for the calling form:
<CODE>
Public Class Form1
Inherits System.Windows.Forms.Form
'Windows Form designer code snipped
Public Declare Sub Encode_L10 Lib "ForrestryDLL.dll" ()

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Encode_L10()

End Sub

End Class
</CODE>

The DLL "ForrestryDLL.dll" is listed under "references" in the solution
explorer. What am I doing wrong?

Ryan
 
I'm working in Visual Basic.net and I'm new to creating DLLs. I ran
into a problem creating a simple DLL. I used this newsgroup to try and
figure out what was wrong and I'm still stuck with an
entrypointnotfound error. What do I need to do to make this simple
subroutine call work?

VB.NET cannot be used to create applications which export functions that can
be used with 'Declare'.
This is the code for the DLL:
<CODE>
Public Class returnNumber
Public Sub Encode_L10()
MsgBox("Returns a 10")
End Sub
End Class
</CODE>

Use this code to call the function:

\\\
Imports ClassLibrary1
..
..
..
Dim r As New ReturnNumber()
r.Encode_L10()
///
 
Back
Top