Welcome to Dream.In.Code
Become a VB Expert!

Join 137,362 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,810 people online right now. Registration is fast and FREE... Join Now!




Writing Dll's In Vb

 
Reply to this topicStart new topic

Writing Dll's In Vb, DLL Tutorial

born2c0de
5 Jan, 2005 - 02:02 AM
Post #1

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
Hey,
Does anybody know a link for a tutorial that teaches you how to write DLL's in Visual Basic?
I know how to write them in C and use them in Visual Basic,Pascal etc. and I tried seatching...but couldnt find any good ones.

How do we write a DLL from Visual Basic? Any idea?

Thanks.
User is online!Profile CardPM
+Quote Post

Amadeus
RE: Writing Dll's In Vb
5 Jan, 2005 - 07:07 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,230



Thanked: 40 times
Dream Kudos: 25
My Contributions
I think this one is alright, although I may find it so because it speaks to coding dlls in VB for use with ASP.
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Writing Dll's In Vb
5 Jan, 2005 - 08:15 AM
Post #3

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
i checked it out...the dll works fine...but only on web-pages. It wont work for standalone applications.
Thanks though....Has anyone else had any luck?
User is online!Profile CardPM
+Quote Post

plaguethenet
RE: Writing Dll's In Vb
8 Jan, 2005 - 05:57 PM
Post #4

New D.I.C Head
*

Joined: 8 Jan, 2005
Posts: 10

QUOTE(born2c0de @ Jan 5 2005, 09:15 AM)
i checked it out...the dll works fine...but only on web-pages. It wont work for standalone applications.
Thanks though....Has anyone else had any luck?

are you using server.createobject in your vb code?

In reference to this section of the page you looked at:


QUOTE(Creating Visual Basic Components for ASP)
Creating the webpage
Open your HTML editor and type the following lines.

<HTML
<TITLE>Simple Calculator Test</TITLE>
<BODY>
<%
Dim AddResult,SubResult,MulResult,DivResult
Dim AddNum,SubNum,MulNum,DivNum

Set AddNum=Server.CreateObject("SimpleCalculator.Addnumbers")

This line of code will create the object which will allow us to interact with our dll "SimpleCalculator". It references the class object "AddNumbers".


Result=AddNum.Add(140774,51174)


if so try this



<-------------CUT HERE --------------------->

Private Sub Command1_Click()
Dim Result
Dim AddNum as Object
'Note in the following line there is no server. in front of CreateObject.
'Also note that VB will not show class members on the created object
'like it does with say... form. it will not do anything. so you must have
'a reference to what the classes members are.
Set AddNum=CreateObject("SimpleCalculator.Addnumbers")

Result=AddNum.Add(140774,51174)

msgbox "140774 + 51174 = " + str(result)
end sub


<-------------CUT HERE --------------------->

Hope this helps if it dosent i will also post some code to one of my programs.
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Writing Dll's In Vb
9 Jan, 2005 - 07:32 AM
Post #5

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
thanks....but i'd appreciate it more if you would attach your code as well....it will help me much more.
User is online!Profile CardPM
+Quote Post

plaguethenet
RE: Writing Dll's In Vb
9 Jan, 2005 - 01:30 PM
Post #6

New D.I.C Head
*

Joined: 8 Jan, 2005
Posts: 10

This is the code from the dll (Project Name: TestDLL)
Class Name: PInfo
CODE

Const P_APP_EXTENDER = 2
Const P_APP_VALIDATION = 3
Const P_APP_INPUT = 4
Const P_APP_OUTPUT = 5
Const P_APP_ENGINE = 6

Const Auth = "kp404"
Const PName = "Plugin Name"

Function Identity() As String
Identity = "[" + Auth + "] " + PName + "(" + Version + ")"
End Function

Function Version() As String
Version = Str(App.Major) + "." + Str(App.Minor) + " r" + Str(App.Revision)
End Function

Function PType() As Integer
'Choose One Of The Following
'PType = P_APP_EXTENDER
' Adds New UI Items, Splash Screens, Modifies
' Menus..... (Not Yet Implemented)
'PType = P_APP_VALIDATION
' Adds a Validation Layer To the Application,
' Along with an ID It can be used to validate
' passwords and so on...
PType = P_APP_INPUT
' This plugin accepts Input from the user.
' If an id is specified it will be validated
' with A P_APP_VALIDATION
'PType = P_APP_OUTPUT
' This Provides Output to the user.
'PType = P_APP_ENGINE
' This Type has the responsability of using
' all the other types to make one application
End Function


And Here is the code to load the dll

CODE


Dim obj as Object

Set Obj = CreateObject("TestDLL.PInfo")
msgbox Obj.Identity




The MessageBox Should Contain [kp404] Plugin Name

Attached is the complete source to this This is free code that i have trashed and do not want. I Learned a better way to do what i was doing so do what you will with it. Project is VB 6.0 SP 6


Next Post Will Contain another Project ZIP


Attached File(s)
Attached File  PluginSystem.zip ( 73.4k ) Number of downloads: 360
User is offlineProfile CardPM
+Quote Post

plaguethenet
RE: Writing Dll's In Vb
9 Jan, 2005 - 01:32 PM
Post #7

New D.I.C Head
*

Joined: 8 Jan, 2005
Posts: 10

This is a Demo of two dll's that control a form by passing the form as an argument to a dll


Attached File(s)
Attached File  DllDemo.zip ( 16.62k ) Number of downloads: 727
User is offlineProfile CardPM
+Quote Post

born2c0de
RE: Writing Dll's In Vb
10 Jan, 2005 - 10:01 AM
Post #8

printf("I'm a %XR",195936478);
Group Icon

Joined: 26 Nov, 2004
Posts: 3,935



Thanked: 34 times
Dream Kudos: 2800
Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions
wow...thanks a million
User is online!Profile CardPM
+Quote Post

plaguethenet
RE: Writing Dll's In Vb
10 Jan, 2005 - 11:08 AM
Post #9

New D.I.C Head
*

Joined: 8 Jan, 2005
Posts: 10

No Prob. I Was reading your profile. Please e-mail me i have a business proposition.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/5/08 01:07AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month