*DLL* [Tutorial] Make Your first DLL Interacted to a Form Project...

Posts 1–15 of 15 · Page 1 of 1
*DLL* [Tutorial] Make Your first DLL Interacted to a Form Project...
Hey Hey Hey! The Following tutorial will show you how to make a DLL and how to interact it to a WindowsFormApplication!
*Note: The following tutorial will NOT show how to make a hack in a dll, just a simple program... You can start from here learning about dlls, so don't mess me with stupid questions and comments!

Ok Lets Start...


-----------------------------------------------------------------
The Dll
-----------------------------------------------------------------

Open Visual Basic, Start a new project, name it to whatever you want and select Class Library, then press OK...

Now you should see on the right "My Project", Press it...
Now a new window should appear with many informations about your project, in the Tabs, press "Reference"
A New window will appear and there is a button named of "Add..."
Press It!
A New window appears and there you must search for:
"System.Windows.Forms" in .NET Tab...
When you find it, selelect it and press OK...
Now, go to your DLL File Named of "Class1" that you can find on the right...
Type the following code on top, upper then "Public Class Class1":
Code:
Imports System.Windows.Forms
Ok now type the following code between "Public Class Class1" and "End Sub":
Code:
Public Sub ShowErrorMessage(ByVal TheText As String)
MsgBox(TheText, MsgBoxStyle.Critical, "Error")
Now...
Down of "End Sub" Type the following:
Code:
Public Sub AddText(ByVal Box As TextBox, ByVal Text As String)
Box.Text += Text
End Sub

Now it should look like this:
Code:
Imports System.Windows.Forms
Public Class Class1
    Public Sub ShowErrorMessage(ByVal TheText As String)
        MsgBox(TheText, MsgBoxStyle.Critical, "Error")
    End Sub

    Public Sub AddText(ByVal Box As TextBox, ByVal Text As String)
        Box.Text += Text
    End Sub
End Class
If it looks like that Save your project...
By going o "File" and Save All... Save to your Desktop or whenever you want... Then (IMPORTANT Build your Project by going to "Build" and "Build (your project name)"



-----------------------------------------------------------------
The Form and Dll Interaction...
-----------------------------------------------------------------


Now... Start a New Project, name it whatever you want and select WindowsFormApplication1

In the form add 2 Buttons, and 2 TextBoxs... At the first TextBox Make it as a MultiLine TextBox and make it bigger... The 2nd Textbox let it as it starts...

Now Go to "My Project" like you did in the DLL Part... And go to "Reference" again, Press "Add..." and go to the "Browse" Tab... There Search for your DLL project, and choose the built project... (bin -> release -> select DLL)

Press button 1 to go to the code index and type right down of "Public Class Form1" the following:
Code:
Dim TheDll As New DLL.Class1
Go to Form1, and press the button 1, type the following on it:
Code:
TheDll.AddText(TextBox1, TextBox2.Text)
Go back to the form and press the button2 and type the following on it:
Code:
TheDll.ShowErrorMessage("Your Message Here")
At the end it should look like this:

Code:
Public Class Form1
    Dim TheDll As New DLL.Class1

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

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TheDll.AddText(TextBox1, TextBox2.Text)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TheDll.ShowErrorMessage("Your Text Here")
    End Sub
End Class
Save All.... Build Project and it should look like this:


Your project is done!

Type anything in the textbox between the 2 buttons, and press Add Text, the text will be added to the bigger textbox... If you press Error Button an Error Mensage will appear with your custom message at the code!

See? Its Quite Simple, now apply your knowledges and build a hack in a dll!

Have Fun!
This is great for people who don't know how to implement D3D into C++ or anything. Great tut.
thats why i did this tutorial....
I have this error " Error 1 Type 'DLL.Class1' is not defined. for this : Public Class Form1
Dim TheDll As New DLL.Class1

so is that possible with this little trick bring up a trainer to the forground like d3d hack?
To fix the Error for 'Dll.Class1 not being defined...
Type "Import "Name of your DLL"
above everything
without the .dll extension, this'll work as long as you built your DLL project
and added it into the refrences
Quote Originally Posted by londasgt View Post
To fix the Error for 'Dll.Class1 not being defined...
Type "Import "Name of your DLL"
above everything
without the .dll extension, this'll work as long as you built your DLL project
and added it into the refrences
thats what I did "
Code:
Imports dllinjector2
Public Class Form1
    Dim TheDll As New DLL.Class1
dllinjector2 is the name of my dll its is added in to the project from references.

The problem is still same it says its not declared the DLL.Class1 !
I found out that YouTube is also a good spot for this, HINT*** <<<< ** <<<<
thank you it realy helped me out :P
(and your fluffy is out of her egg bij me XD)
hey great tut man ! i'm kinda looking forward to make .exe and .dll for my trainer games

i shall try to train on your tut , next i gonna find way to get opt codes in games
Nice tut, I've been trying to learn this C++ and java script, now I have something i can apply to it
Great tutorial dude! Very informative!
Great and Simple, Thanks for this tut
Gratz
Thanked
Can you stick this? Its a good tutorial for new people.
Btw silk can u help me with some hacks some time? I am a very good programmer in vb6 and vb.net 2008. I downloaded your injector in vb6 and edited a little
If you are free add me on msn or private message me. Tnx ^^
thanks manits really nice can u make some other dll based tuts to learn more if it
Posts 1–15 of 15 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us