Predmet:Re: XML po zadanoj shemi
Evo ti ova procedura.
Ona usporava shell odnosno kontrolise kada se zavrsi i provjerava jeli odradjeno pa tek onda dozvoljava dalji tok koda.
PreuzmiIzvorni kôd (Visual Basic):Option Compare Database
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = -1&
' Usporava shel
' to finish, hiding while we wait.
Private Sub UsporiShell(ByVal program_name As String, ByVal window_style As Integer)
Dim process_id As Long
Dim process_handle As Long
' Start the program.
On Error GoTo ShellError
process_id = Shell(program_name, window_style)
On Error GoTo 0
' Wait for the program to finish.
' Get the process handle.
process_handle = OpenProcess(SYNCHRONIZE, 0, process_id)
If process_handle <> 0 Then
WaitForSingleObject process_handle, INFINITE
CloseHandle process_handle
End If
Exit Sub
ShellError:
MsgBox "Error starting task " & _
program_name & vbCrLf & _
Err.Description, vbOKOnly Or vbExclamation, _
"Error"
End Sub
Procedura se poziva:
UsporiShell putanjafajla & "\pkzip " & PutZipa & "\" & ImeFajla & ".zip " & PutZapisa, vbHide
U prilogu zip fajl.
Prilozi:
pkzip_dos.zip
Preuzimanja:198
Velicina datoteke:69.33 KB
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.