应版主之邀,今把上次的寄给 Herro 之源代码贴出:======================================================== 以下在 class1.cls ========================================================= Option ExplicitDim m_left As Long Dim m_Top As Long Public Event TopChanged() Public Event LeftChanged()Public Property Get oldLeft() As Variant oldLeft = m_left End PropertyPublic Property Let oldLeft(ByVal vNewValue As Variant) m_left = vNewValue RaiseEvent LeftChanged End PropertyPublic Property Get oldTop() As Variant oldTop = m_Top End PropertyPublic Property Let oldTop(ByVal vNewValue As Variant) m_Top = vNewValue RaiseEvent TopChanged End PropertyPublic Property Get newTop() As Variant newTop = m_Top + 100 End Property Public Property Get newLeft() As Variant newLeft = m_left + 100 End Property ================================================================ '以下是form1.frm ================================================================Option Explicit Dim WithEvents a As 工程1.Class1 Private Sub a_DllFormClicked() MsgBox "ok" End SubPrivate Sub a_LeftChanged() Me.Left = a.newLeft End SubPrivate Sub a_TopChanged() Me.Top = a.newTop End SubPrivate Sub Form_Load() Form1.AutoRedraw = True Set a = New Class1 Print "请分别按下鼠标左右键,看看有什么发生!" End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then a.oldLeft = Me.Left End If If Button = 2 Then a.oldTop = Me.Top End If End Sub
用ActiceX DLL 来管理相应的线程。
我怎么才能知道ActiceX EXE中的进度呢?
谢谢!那位能帮帮我! E_MAIL:[email protected] oicq: 5533655
以下在 class1.cls
=========================================================
Option ExplicitDim m_left As Long
Dim m_Top As Long
Public Event TopChanged()
Public Event LeftChanged()Public Property Get oldLeft() As Variant
oldLeft = m_left
End PropertyPublic Property Let oldLeft(ByVal vNewValue As Variant)
m_left = vNewValue
RaiseEvent LeftChanged
End PropertyPublic Property Get oldTop() As Variant
oldTop = m_Top
End PropertyPublic Property Let oldTop(ByVal vNewValue As Variant)
m_Top = vNewValue
RaiseEvent TopChanged
End PropertyPublic Property Get newTop() As Variant
newTop = m_Top + 100
End Property
Public Property Get newLeft() As Variant
newLeft = m_left + 100
End Property
================================================================
'以下是form1.frm
================================================================Option Explicit
Dim WithEvents a As 工程1.Class1
Private Sub a_DllFormClicked()
MsgBox "ok"
End SubPrivate Sub a_LeftChanged()
Me.Left = a.newLeft
End SubPrivate Sub a_TopChanged()
Me.Top = a.newTop
End SubPrivate Sub Form_Load()
Form1.AutoRedraw = True
Set a = New Class1
Print "请分别按下鼠标左右键,看看有什么发生!"
End SubPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
a.oldLeft = Me.Left
End If
If Button = 2 Then
a.oldTop = Me.Top
End If
End Sub