(toppers-users 2680) Re: vb.netによるデバイスエミュレーションについて Mitsuru Hirabushi
Kimitsugu Nakao
nakao @ shikoku-pc.ac.jp
2007年 9月 29日 (土) 18:21:04 JST
平武さんへ
中尾と申します。
私の環境では、以下のプログラムで、Visual Basic 2005 Experss Editionで動作
しております。
*引数省略
Private Sub Form1_Load( ) Handles MyBase.Load
DeviceControl1.Connect()
DeviceControl1.Map(&H1234, 1)
End Sub
Private Sub Form1_FormClosed( ) Handles MyBase.FormClosed
DeviceControl1.Close()
End Sub
Private Sub DeviceControl1_OnWrite( ) Handles DeviceControl1.OnWrite
Label1.Text = Str(DeviceControl1.Value)
End Sub
Mapする仮想メモリ番号がマニュアル記載のサンプルと違いますが、Toppers側でも
変更されているのでしょうか。
また、Toppersを起動するとWindowsのタスクバーにDeviceManagerアイコンは表示
されますでしょうか。
すでにご存知かと思われますが、Toppers側ではrキーだけでは数字は変わりませ
ん。
タスクを切り替える2や3などを入力した後にrを入力するとtsknoが変更されます。
________________________________
From: 小永吉 進 [mailto:konagayoshi @ hotmail.com]
Sent: Thursday, September 27, 2007 7:50 PM
To: users @ toppers.jp
Subject: (toppers-users 2679) vb.netによるデバイスエミュレーションに
ついて Mitsuru
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents AxDeviceControl1 As
AxATLDEVICELib.AxDeviceControl
Friend WithEvents Label1 As
System.Windows.Forms.Label
Private Sub Form1_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'AxDeviceControl1 = New
AxATLDEVICELib.AxDeviceControl
InitializeComponent()
AxDeviceControl1.Connect()
AxDeviceControl1.Map(100, 1)
End Sub
Private Sub AxDeviceControl1_OnWrite(ByVal sender As
System.Object, ByVal e As AxATLDEVIC
ELib._IDeviceControlEvents_OnWriteEvent)
Label1.Text() = Str(AxDeviceControl1.Value)
End Sub
Private Sub InitializeComponent()
Dim resources As
System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(Form1))
Me.Label1 = New System.Windows.Forms.Label
Me.AxDeviceControl1 = New
AxATLDEVICELib.AxDeviceControl
CType(Me.AxDeviceControl1,
System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New
System.Drawing.Point(72, 40)
Me.Label1.Name = "Label1"
Me.Label1.Size = New
System.Drawing.Size(168, 72)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Label1"
'
'AxDeviceControl1
'
Me.AxDeviceControl1.Enabled = True
Me.AxDeviceControl1.Location = New
System.Drawing.Point(56, 128)
Me.AxDeviceControl1.Name =
"AxDeviceControl1"
Me.AxDeviceControl1.OcxState =
CType(resources.GetObject("AxDeviceControl1.OcxState"),
System.Windows.Forms.AxHost.State)
Me.AxDeviceControl1.Size = New
System.Drawing.Size(192, 128)
Me.AxDeviceControl1.TabIndex = 2
'
'Form1
'
Me.AutoScaleBaseSize = New
System.Drawing.Size(5, 12)
Me.ClientSize = New System.Drawing.Size(292,
266)
Me.Controls.Add(Me.AxDeviceControl1)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
CType(Me.AxDeviceControl1,
System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Private Sub Form1_Closed(ByVal sender As Object,
ByVal e As System.EventArgs) Handles MyBase.Closed
AxDeviceControl1.Close()
End Sub
End Class
________________________________
MSNミュージックとEMI Artistsが共同開催するオーディション SCHOOL OF
SCHOOL http://music.jp.msn.com/
<http://clk.atdmt.com/GBL/go/msnjpqjl0040000009gbl/direct/01/>