home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 35
/
hot35.iso
/
ficheros
/
LVB
/
T2W32534.ZIP
/
_MAILNWS.FRM
< prev
next >
Wrap
Text File
|
1998-05-02
|
12KB
|
332 lines
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
Begin VB.Form frmMailNews
BorderStyle = 4 'Fixed ToolWindow
Caption = "Miscelleanous"
ClientHeight = 6060
ClientLeft = 1890
ClientTop = 3270
ClientWidth = 9270
MaxButton = 0 'False
MDIChild = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 6060
ScaleWidth = 9270
ShowInTaskbar = 0 'False
Begin VB.TextBox txt_Result
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Height = 5325
Left = 105
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
Top = 630
Width = 9060
End
Begin Threed.SSPanel SSPanel1
Align = 1 'Align Top
Height = 480
Left = 0
TabIndex = 1
Top = 0
Width = 9270
_Version = 65536
_ExtentX = 16351
_ExtentY = 847
_StockProps = 15
ForeColor = -2147483640
BackColor = 12632256
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1365
TabIndex = 2
Top = 90
Width = 6585
End
Begin Threed.SSCommand SSCommand1
Default = -1 'True
Height = 300
Left = 8415
TabIndex = 6
Top = 90
Width = 465
_Version = 65536
_ExtentX = 820
_ExtentY = 529
_StockProps = 78
Caption = "&Go"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin Threed.SSCommand cmdNP
Height = 300
Index = 0
Left = 8100
TabIndex = 4
Top = 90
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 529
_StockProps = 78
Caption = "<"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
Font3D = 3
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin Threed.SSCommand cmdNP
Height = 300
Index = 1
Left = 8940
TabIndex = 3
Top = 90
Width = 255
_Version = 65536
_ExtentX = 450
_ExtentY = 529
_StockProps = 78
Caption = ">"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BevelWidth = 1
Font3D = 3
RoundedCorners = 0 'False
Outline = 0 'False
End
Begin VB.Label Label2
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 5
Top = 120
Width = 1275
End
End
End
Attribute VB_Name = "frmMailNews"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 100
Dim IsLoaded As Integer
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmdNP_Click(Index As Integer)
Call sub_NextPrev(cmb_Function, Index)
End Sub
Private Sub cmb_Function_Click()
If (IsLoaded = False) Then Exit Sub
Call cDisableFI(mdiT2W.Picture1)
txt_Result = ""
DoEvents
Select Case cmb_Function.ListIndex
Case 0
Call TestMailNews
End Select
DoEvents
Call cEnableFI(mdiT2W.Picture1)
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
IsLoaded = False
Show
Call sub_Load_Combo(cmb_Function, T2WDirInst + "_mailnws.t2w")
IsLoaded = True
End Sub
Private Sub SSCommand1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestMailNews()
Dim lResult As Long
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim File1 As String
Dim File2 As String
Dim File3 As String
Dim Ptr As Long
Dim NextPtr As Long
Dim FileName As String
Dim TypeOfEncoding As Integer
Dim FileState As Long
Dim rc As Integer
Dim ErrorDecodeOp As Long
Dim ErrorMoveOp As Long
ReDim FileM(1 To 3) As String
strResult = ""
strDisplay = ""
File1 = T2WFileTest
File2 = "autoexec.mailnews"
strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
strDisplay = strDisplay & "Encoding (if [ok] then [size of file] else [error]) with " & vbCrLf
strDisplay = strDisplay & " header : MNHDR_MAIL" & vbCrLf
strDisplay = strDisplay & " linesperfile : 0 (=> single-part)" & vbCrLf
strDisplay = strDisplay & " sender : T2WIN-32" & vbCrLf
strDisplay = strDisplay & " receiver : The MCR Company" & vbCrLf
strDisplay = strDisplay & " subject : Mail & News from TIME TO WIN 32-Bit (...))" & vbCrLf & vbCrLf
FileM(1) = "autoexec.uuencode"
strDisplay = strDisplay & " initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
strDisplay = strDisplay & " encode '" & File2 & "' into '" & FileM(1) & "' (uuencode) is " & cMNEncode(File2, FileM(1), FileM(1), MN_UU_ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (UUENCODED)") & vbCrLf
strDisplay = strDisplay & " shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
FileM(2) = "autoexec.xxencode"
strDisplay = strDisplay & " initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
strDisplay = strDisplay & " encode '" & File2 & "' into '" & FileM(2) & "' (xxencode) is " & cMNEncode(File2, FileM(2), FileM(2), MN_XX_ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (XXENCODED)") & vbCrLf
strDisplay = strDisplay & " shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
FileM(3) = "autoexec.b64encode"
strDisplay = strDisplay & " initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
strDisplay = strDisplay & " encode '" & File2 & "' into '" & FileM(3) & "' (b64encode) is " & cMNEncode(File2, FileM(3), FileM(3), MN_B64ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (B64ENCODED)") & vbCrLf
strDisplay = strDisplay & " shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
File3 = "autoexec.compound"
strDisplay = strDisplay & "Merge '" & FileM(1) & "' and '" & FileM(2) & "' and '" & FileM(3) & " into '" & File3 & "' is " & cFileMergeExt(FileM(), File3) & vbCrLf & vbCrLf
strDisplay = strDisplay & "Loading '" & File3 & "' in the list of files to be processed" & vbCrLf & vbCrLf
strDisplay = strDisplay & " initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
strDisplay = strDisplay & " loadinlist is " & cMNLoadInList(File3, False) & vbCrLf
strDisplay = strDisplay & " countinlist is " & cMNCountInList() & vbCrLf & vbCrLf
strDisplay = strDisplay & " enumeration of all files in the current list of files :" & vbCrLf & vbCrLf
If (cMNFirstInList(Ptr) = True) Then
i = 1
Do
rc = cMNWalkInList(Ptr, FileName, TypeOfEncoding, FileState, NextPtr)
strDisplay = strDisplay & " file(" & i & ") is '" & FileName & "' (typeofencoding : " & TypeOfEncoding & ", filestate : " & FileState & ")" & vbCrLf
i = i + 1
Ptr = NextPtr
Loop Until rc = False
strDisplay = strDisplay & vbCrLf
Else
strDisplay = strDisplay & " no files found" & vbCrLf & vbCrLf
End If
strDisplay = strDisplay & " shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
strDisplay = strDisplay & " Decoding of all files in the current list of files" & vbCrLf & vbCrLf
strDisplay = strDisplay & " initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
strDisplay = strDisplay & " loadinlist is " & cMNLoadInList(File3, False) & vbCrLf
strDisplay = strDisplay & " countinlist is " & cMNCountInList() & vbCrLf & vbCrLf
If (cMNFirstInList(Ptr) = True) Then
i = 1
Do
rc = cMNWalkInList(Ptr, FileName, TypeOfEncoding, FileState, NextPtr)
strDisplay = strDisplay & " file(" & i & ") is '" & FileName & "'" & vbCrLf
strDisplay = strDisplay & " rename into 'testmailnews.tst" & i & "' is " & IIf(cMNRenameInList(Ptr, "testmailnews.tst" & i) = MNRET_OK, "OK", "error") & vbCrLf
strDisplay = strDisplay & " decode is " & cMNDecodeFromList(Ptr, FileState, ErrorDecodeOp, ErrorMoveOp) & vbCrLf
strDisplay = strDisplay & " compare with '" & File2 & "' is " & IIf(cCmpFileContents("testmailnews.tst" & i, File2, False) = -1, "same", "not same") & vbCrLf
i = i + 1
Ptr = NextPtr
Loop Until rc = False
strDisplay = strDisplay & vbCrLf
Else
strDisplay = strDisplay & " no files found" & vbCrLf & vbCrLf
End If
strDisplay = strDisplay & " shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
txt_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
lResult = cMNInitialize()
lResult = cMNEncode(File2, FileM(3), FileM(3), MN_B64ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (B64ENCODED)")
lResult = cMNShutdown()
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub