DLL Entry Point question

  • Thread starter Thread starter mutant
  • Start date Start date
M

mutant

Guest
Hi.

When im trying to use my DLL in my app i get an error that it couldnt find an entry point for the given function. :confused:

Can anyone help me plz? Im new to DLLs :)
 
Is the DLL referenced by your project? (right-click the project and Add References, then browse for the DLL)

Does the DLL expose any of its methods/properties/functions?
 
I would assume if its complaining about not finding an entry point, youre trying to use a C-style DLL from .NET, in which case youve got the name of the function wrong.

Can you paste your declare here if it still doesnt work?
 
Yeh, i referenced it in the project.
Im using the class library vb template for making the dll.
I referenced it, then declared the function, its still complaining about no entry point.

What declaration you want to see?

Can anyone give me an example of a simple DLL plz, and the declaration for it
 
If youre referencing a .NET dll you dont have to declare anything, as soon as the library is referenced you can create instances of the classes within in.
 
and when i try to register the dll it says it cannot find the entry point for the system to register it.
im just gonna past a simple code, can you tell me what to add to it, cause it doesnt work when i just do this.

Code:
Public Class Class1
    Public Function Funct(ByVal functi As String) As Boolean
        function body...
    End Function
End Class

can you plz tell me what am i supposed to add to this?
 
You dont register the DLL with RegSvr32. They are not activeX
DLLs. Simply add a reference to it in your project and you can
use it.
 
i still doesnt work, even when i reference it.
i guess i just gotta give up on DLLs :(
 
Maybe you could include the project, or at least the entire source for the file thats trying to use the DLL? Also, exactly what is the DLL youre using (a C DLL, an ActiveX COM DLL, or a managed .NET DLL)? If you dont know, just describe where you got it or what it does.

The more details the better. :)

-nerseus
 
Ok, i will try to answer all your questions :)

I dont think there is a need to include source cause it just contains one line that i typed with the name of function and values, cause before i do anything real with the dlls i wanna learn how all that works.

The DLL was made using the Class Library Template from vb section of the New Project dialog. Its something simple like add two numbers, cause as i said before im just experimenting now with DLLs

I just dont know what to do :confused:
 
You dont need a declare statement at all. After you build your first project, youll end up with a DLL.

From your test project, youll have to add a reference to that DLL. Once youve got the reference, youll have to create an object of that type. Suppose the class in your DLL is called ClassA with a method named AddNumbers(), use something like this in your test project:
Code:
Dim o As New ClassA()
Dim i As Integer
i = o.AddNumbers(5, 6)

-nerseus
 
Back
Top