接著無奈下不管37 21
按下編譯 -> test.exe
執行(test.exe) 結果沒出現警訊
??
這次在
VB 上多加個除錯,變成
Option Explicit
Private Declare Function ShowMsg Lib "test2.dll" Alias "ShowMsgW" (ByVal send As String, ByVal hWnd As Long) As Integer
Private Sub Command1_Click()
Dim send As String
On Error GoTo NoDoThing
send = "Hello,World!"
Call ShowMsg(send, Me.hWnd)
Exit sub
NoDoThing:
MsgBox "Error"
End Sub
結果
VB 內就是先正確彈出 VC++的 MessageBox 內容
接著 彈出 VB的 "Error"
同樣 編譯成 test2.exe
執行
只得到 VC++的 MessageBox 內容
??
真是搞不懂,VB 內模擬 與 .exe 情況之差異