Okay I am working on a project that is requiring us to submit dll's for calls.
Currently all the calls are made from the exe file that was written in VB6, yes we are upgrading. I have been playing around with creating dll's and actually have that part of it down just doing basic things for practice.
The realization is that the current program calls other forms to open for the different tasks. the different forms need to be called when that task is selected.
I have created a small program, it just does math functions. The main form lets you select what math function you want to perform. that calls another form that lets you enter the data. clicking on a a button calls the dll to perform the function. pretty simple.
What I would like to do is have the main form call the dll which will open the form for input and do the calculation. Which is on the idea of what we are going to have to do for the other program eventually.
The call from the Main form:
Private Sub btnAdd_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
frmadd.ShowDialog()
End Sub
Inputting data form: Input 2 numbers button click adds(this is where the dll is called) them and a close button to close form.
Imports Multiply1
Public Class frmadd
Private Sub frmadd_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim Adding As New Multiply1.MyAdd
txtAddAns.Text = Adding.AddMyValues(CDbl(txtbox1.Text), CDbl(txtbox2.Text)).ToString
End Sub
Private Sub btndone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndone.Click
Me.Close()
End Sub
End Class
This the code for dll
Public Class MyAdd
Public Function AddMyValues(ByVal Value1 As Double, ByVal Value2 As Double)
Dim Result As Double
Result = Value1 + Value2
Return Result
End Function
End Class
I have read several different articles but the one thing they don't do is show how to create the form then have have the dll call it. Maybe I am missing something easy but I just can't see it.
Scott