By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

entrypointnotfound error although a DLL is referenced

P: n/a

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

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<rm*****@2t.com> schrieb:
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()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

P: n/a

Herfried,

Outstanding. Everything worked. Thank you for your help.

Ryan

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.