Public Class Form1
Inherits System.Windows.Forms.Form
'API宣言
<System.Runtime.InteropServices.DllImport("macro.dll")> _
Private Shared Sub setVari(ByVal name As String, ByVal data As String)
End Sub
<System.Runtime.InteropServices.DllImport("macro.dll")> _
Private Shared Function getVari(ByVal name As String) As String
End Function
<System.Runtime.InteropServices.DllImport("macro.dll")> _
Private Shared Sub start()
End Sub
・・・・・・・・・・・・・・・・・・・・・・
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = 6
TextBox2.Text = 2
Button1.Text = "add"
Button2.Text = "sub"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
setVari("a", TextBox1.Text)
setVari("b", TextBox2.Text)
setVari("mode", "add")
start()
TextBox3.Text = getVari("c")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
setVari("a", TextBox1.Text)
setVari("b", TextBox2.Text)
setVari("mode", "sub")
start()
TextBox3.Text = getVari("c")
End Sub
End Class