查看單個文章
舊 2004-09-10, 01:27 AM   #6 (permalink)
s.h.e. 帥哥
註冊會員
榮譽勳章

勳章總數0
UID - 67994
在線等級: 級別:3 | 在線時長:25小時 | 升級還需:7小時級別:3 | 在線時長:25小時 | 升級還需:7小時級別:3 | 在線時長:25小時 | 升級還需:7小時
註冊日期: 2003-05-14
VIP期限: 2006-10
文章: 38
精華: 0
現金: 41 金幣
資產: 41 金幣
預設

附上某些電腦會發生錯誤的程式碼,在Form上只有引用CommonDialog及加上功能表,就連單獨包成一個Setup,能執行的能執行,原本不能執行的也不能執行,所以問題是出在這裡。引用API是沒問題的,因為我做了一個Form來跳出兩個Form,不管是否引用都會錯誤...比較了Setup.lst,該引用的都有進來....


Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Form_Load()
frmSplash.Show
start = Timer
Do While Timer < start + 1.5
DoEvents
Loop
Unload frmSplash
mnuSetup.Enabled = False
End Sub

Private Sub frmCompact_Click()
frmCompactDB.Show vbModal
End Sub

Private Sub mnuExport_Click()
frmExport.Show vbModal
End Sub

Private Sub mnuOpen_Click()
' 顯示開啟檔案對話方塊
Dim Ftemp As String '暫存原檔名
dlgDialog.FileName = ""
dlgDialog.Flags = FileOpenConstants.cdlOFNFileMustExist
dlgDialog.DialogTitle = "開啟 Access 資料庫檔案"
dlgDialog.Filter = "Access 97-2003 (*.mdb)|*.mdb|"
dlgDialog.ShowOpen
Ftemp = OpenFileName
If Len(dlgDialog.FileName) > 0 Or OpenFileName <> Ftemp Then
FinishNewName = False '是否進入MDBOUTSET之準則
Tn = 1 '重設自動產生輸出檔名計數器
TableName = ""
OpenFileName = dlgDialog.FileName
OpenFileType = dlgDialog.FilterIndex
mnuSetup.Enabled = True
End If
End Sub

Private Sub mnuAbout_Click()
frmAbout.Show vbModal
End Sub

Private Sub mnuDelLog_Click()
MsgBox "確定要刪除Log檔嗎?", vbOKCancel + vbQuestion, "刪除log檔"
If rtn = vbOK Then
Kill App.Path & "\Outputlog.log"
End If
End Sub

Private Sub mnuEnd_Click()
End
End Sub


Private Sub mnuHelpFile_Click()
ShellExecute 0, "open", App.Path & "\Manual.pdf", "", App.Path, 1
End Sub

Private Sub mnuLog_Click()
If Dir(App.Path & "\outputlog.log") = "" Then
MsgBox "請先完成分割後,系統自動產生記錄檔!", vbExclamation, "找不到Log檔案"
Else
ShellExecute 0, "open", App.Path & "\OutputLog.log", "", App.Path, 1
End If
End Sub

Private Sub mnuSaveAs_Click()
frmConvert.Show vbModal
End Sub

Private Sub mnuSimple_Click()
SavedCount = 0
Setup.Show
End Sub

Private Sub munCross_Click()
frmCrossSetting.Show
End Sub
s.h.e. 目前離線  
送花文章: 0, 收花文章: 0 篇, 收花: 0 次
回覆時引用此帖