Creating DLLs

  • Thread starter Thread starter Jeff Ostapchuk
  • Start date Start date
J

Jeff Ostapchuk

I'm sort of new to DLL creating, so I was hopeing that someone could give me
a little bit of help.

I have this information here in a DLL file:

Public Class ED_L1

Public Sub Encode_L1()

MsgBox("Tada!!!")

End Sub

End Class

I have this information here in the EXE file:

Public Declare Sub Encode_L1 Lib "EncL1.dll" ()

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

Encode_L1()

End Sub

Except when I run the program, I get this error:

An unhandled exception of type 'System.EntryPointNotFoundException' occurred
in CEnc.exe

Additional information: Unable to find an entry point named Encode_L1 in DLL
EncL1.dll.


So, what am I doing wrong? ( lol, I bet it's something real simple. ^.^ )
 
* "Jeff Ostapchuk said:
I'm sort of new to DLL creating, so I was hopeing that someone could give me
a little bit of help.

I have this information here in a DLL file:

Public Class ED_L1

Public Sub Encode_L1()

MsgBox("Tada!!!")

End Sub

End Class

I have this information here in the EXE file:

Public Declare Sub Encode_L1 Lib "EncL1.dll" ()

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

Encode_L1()

End Sub

Except when I run the program, I get this error:

An unhandled exception of type 'System.EntryPointNotFoundException' occurred
in CEnc.exe

Additional information: Unable to find an entry point named Encode_L1 in DLL
EncL1.dll.

You cannot export functions for use with 'Declare' in VB.NET. Instead,
add a reference to the DLL, then use this code:

\\\
Dim x As New ED_L1()
x.Encode_L1()
///
 
I wanted to know, if you could tell me, how would I pull it in through a
declare statement? Just so I know how to.
 
* Ostapchuk Jeff said:
I wanted to know, if you could tell me, how would I pull it in through a
declare statement? Just so I know how to.

It's not supported. You cannot use .NET DLLs with 'Declare'.
 
Back
Top