VB6.0用掲示板の過去のログ(No.1)−VBレスキュー(花ちゃん)
[記事リスト] [新規投稿] [新着記事] [ワード検索] [過去ログ] [管理用]

投稿日: 2002/11/14(Thu) 22:38
投稿者KKK
Eメール
URL
タイトルFileCopyでのエラー

いつもお世話になってます。
下のプルグラムのように、ファイルのコピーが終了するまでその先の作業を実行させないようにAPIを使っているのですが、困ったことにFileCopyのところで”Functionまたは変数が必要です”メッセージが出るのですが、何が原因なのかわかりません。
よろしくお願いします。

Public Function BuckUp()
    Dim StrFileTo_Dom As String
    
    'バックアップファイルの作成
    On Error GoTo buckup_err
        StrFileTo_Dom = "\\Fhit_server\G$\test.txt"                
    IDProcess = FileCopy(StrFileForm, StrFileTo_Dom)          
        ExitCode = ProcessWait(IDProcess)
        If ExitCode = RC_NORMAL Then
            BuckUp = RC_NORMAL←0です
        Else
            BuckUp = RC_ABORT←1です
            Exit Function
        End If
        Exit Function
buckup_err:
        BuckUp = RC_ABORT
        
End Function


Function ProcessWait(ID As Long) As Long
Dim hProcess As Long, ExitCode As Long, ret As Long

    hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 1, ID)
    Do
        ret = GetExitCodeProcess(hProcess, ExitCode)
        DoEvents
    Loop While (ExitCode = STILL_ACTIVE)
    ret = CloseHandle(hProcess)
    ProcessWait = ExitCode
        
End Function


- 関連一覧ツリー (★ をクリックするとツリー全体を一括表示します)

- 返信フォーム (この記事に返信する場合は下記フォームから投稿して下さい)

- Web Forum -