hi leute,
ich möchte gerne eien animierte Statusbar erzeugen.
Leider erhalte ich immer folgenden Fehler: "Falscher Datentyp in Methode NRun: FROMVAR wurde gefunden, Unknown wurde erwartet"
Wenn hier jemand weiter weiß... ich wäre doch sehr dankbar^^
Deklariert
Declare Function NEMProgressBegin Lib "nnotesws.dll" ( ByVal wFlags As Integer ) As Long
Declare Sub NEMProgressDeltaPos Lib "nnotesws.dll" ( ByVal hwnd As Long, ByVal dwIncrement As Long )
Declare Sub NEMProgressEnd Lib "nnotesws.dll" ( ByVal hwnd As Long )
Declare Sub NEMProgressSetBarPos Lib "nnotesws.dll" ( ByVal hwnd As Long, ByVal dwPos As Long)
Declare Sub NEMProgressSetBarRange Lib "nnotesws.dll" ( ByVal hwnd As Long, ByVal dwMax As Long )
Declare Sub NEMProgressSetText Lib "nnotesws.dll" ( ByVal hwnd As Long, ByVal pcszLine1 As String, ByVal pcszLine2 As String )
Const NPB_TWOLINE = 3
Const NPB_ONELINE = 2
Aufruf
Set dc = db.Alldocuments
allDocs = CLng(dc.Count)
Set pb = progressbarRun(aktuell,allDocs)
Set doc = dc.Getfirstdocument()
While Not doc Is Nothing
Set docnext = dc.Getnextdocument(doc)
Call doc.Remove(true)
Set doc = docnext
aktuell = aktuell+1
Call pb.SetProgressPos(aktuell)
Call pb.SetText("Form: ",doc.getitemValue("form")(0))
Wend
die Function progressbarRun
Function progressbarRun(aktuell As Long,range As Long)
Dim pb As New LNProgressBar(True)
Call pb.SetProgressRange(range)
Call pb.SetText("This is line one","This is line two")
Call pb.SetProgressPos(aktuell)
Delete pb
End Function
Die Klasse
Class LNProgressbar
hwnd As Long
Sub New(SecondLineVisible As Integer)
If SecondLineVisible Then
hwnd = NEMProgressBegin(NPB_TWOLINE)
Else
hwnd = NEMProgressBegin(NPB_ONELINE)
End If
End Sub
Sub SetText(FirstLineText As String,SecondLineText As String)
NemProgressSetText hwnd, FirstLineTExt,SecondLineText
End Sub
Sub SetProgressPos(Progresspos As Long)
NEMProgressSetBarPos hwnd, ProgressPos
End Sub
Sub SetProgressRange(ProgressMaxElements As Long)
NEMProgressSetBarRange hwnd, ProgressMaxElements
End Sub
Sub DeltaPos(DPos As Long)
NEMProgressDeltaPos hwnd, DPos
End Sub
Sub Delete
Sleep 2
NEMProgressEnd hwnd
End Sub
End Class