![]() |
/* Sato_Sample.exe (VisualBasic) */ Private Sub nstep_value_ok_Click() Dim a, b, d As Long Dim c As Double a = Val(nstep_value.Text) ' <--MakeDLLにnstepを送る Call SatoSample(a, b, c, d) ' <--SatoSample関数をリンクする answer1.Text = Str(c) ' <--cの値を表示 End Sub Private Sub speed_value_ok_Click() Dim a, b, d As Long Dim c As Double b = Val(speed_value.Text) ' <--MakeDLLにnstepを送る Call SatoSample(a, b, c, d) ' <--SatoSample関数をリンクする answer2.Text = Str(d) ' <--cの値を表示 End Sub |
/* MakeDLL.dll (Visual C++ DLL) */ DLL_EXPORT void CCONV SatoSample(long nstep, long speed, double* rotation, long* time){ *rotation = (double)nstep / 150000; ←VisualBasicより入力されたnstepを回転数に変換 *time = speed * 15000; ←VisualBasicより入力されたspeedを時間に変換 } |