entrypointnotfound error although a DLL is referenced

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rmcbeth@2t.com

    entrypointnotfound error although a DLL is referenced


    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
    entrypointnotfo und 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.d ll" ()

    Private Sub frmMain_Load(By Val sender As System.Object, ByVal e As
    System.EventArg s) Handles MyBase.Load

    Encode_L10()

    End Sub

    End Class
    </CODE>

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

    Ryan

  • Herfried K. Wagner [MVP]

    #2
    Re: entrypointnotfo und error although a DLL is referenced

    <rmcbeth@2t.com > schrieb:[color=blue]
    > 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
    > entrypointnotfo und error. What do I need to do to make this simple
    > subroutine call work?[/color]

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

    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/>

    Comment

    • rmcbeth@2t.com

      #3
      Re: entrypointnotfo und error although a DLL is referenced


      Herfried,

      Outstanding. Everything worked. Thank you for your help.

      Ryan

      Comment

      Working...