home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / LVB / T2W32523.ZIP / _MAILNWS.FRM < prev    next >
Text File  |  1998-04-07  |  12KB  |  332 lines

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  3. Begin VB.Form frmMailNews 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Miscelleanous"
  6.    ClientHeight    =   6060
  7.    ClientLeft      =   1890
  8.    ClientTop       =   3270
  9.    ClientWidth     =   9270
  10.    MaxButton       =   0   'False
  11.    MDIChild        =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   6060
  14.    ScaleWidth      =   9270
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.TextBox txt_Result 
  17.       BackColor       =   &H00C0C0C0&
  18.       BorderStyle     =   0  'None
  19.       Height          =   5325
  20.       Left            =   105
  21.       Locked          =   -1  'True
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   0
  25.       Top             =   630
  26.       Width           =   9060
  27.    End
  28.    Begin Threed.SSPanel SSPanel1 
  29.       Align           =   1  'Align Top
  30.       Height          =   480
  31.       Left            =   0
  32.       TabIndex        =   1
  33.       Top             =   0
  34.       Width           =   9270
  35.       _Version        =   65536
  36.       _ExtentX        =   16351
  37.       _ExtentY        =   847
  38.       _StockProps     =   15
  39.       ForeColor       =   -2147483640
  40.       BackColor       =   12632256
  41.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  42.          Name            =   "MS Sans Serif"
  43.          Size            =   8.25
  44.          Charset         =   0
  45.          Weight          =   400
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Begin VB.ComboBox cmb_Function 
  51.          Height          =   315
  52.          Left            =   1365
  53.          TabIndex        =   2
  54.          Top             =   90
  55.          Width           =   6585
  56.       End
  57.       Begin Threed.SSCommand SSCommand1 
  58.          Default         =   -1  'True
  59.          Height          =   300
  60.          Left            =   8415
  61.          TabIndex        =   6
  62.          Top             =   90
  63.          Width           =   465
  64.          _Version        =   65536
  65.          _ExtentX        =   820
  66.          _ExtentY        =   529
  67.          _StockProps     =   78
  68.          Caption         =   "&Go"
  69.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  70.             Name            =   "MS Sans Serif"
  71.             Size            =   8.25
  72.             Charset         =   0
  73.             Weight          =   400
  74.             Underline       =   0   'False
  75.             Italic          =   0   'False
  76.             Strikethrough   =   0   'False
  77.          EndProperty
  78.          BevelWidth      =   1
  79.          RoundedCorners  =   0   'False
  80.          Outline         =   0   'False
  81.       End
  82.       Begin Threed.SSCommand cmdNP 
  83.          Height          =   300
  84.          Index           =   0
  85.          Left            =   8100
  86.          TabIndex        =   4
  87.          Top             =   90
  88.          Width           =   255
  89.          _Version        =   65536
  90.          _ExtentX        =   450
  91.          _ExtentY        =   529
  92.          _StockProps     =   78
  93.          Caption         =   "<"
  94.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  95.             Name            =   "MS Sans Serif"
  96.             Size            =   8.25
  97.             Charset         =   0
  98.             Weight          =   400
  99.             Underline       =   0   'False
  100.             Italic          =   0   'False
  101.             Strikethrough   =   0   'False
  102.          EndProperty
  103.          BevelWidth      =   1
  104.          Font3D          =   3
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.       Begin Threed.SSCommand cmdNP 
  109.          Height          =   300
  110.          Index           =   1
  111.          Left            =   8940
  112.          TabIndex        =   3
  113.          Top             =   90
  114.          Width           =   255
  115.          _Version        =   65536
  116.          _ExtentX        =   450
  117.          _ExtentY        =   529
  118.          _StockProps     =   78
  119.          Caption         =   ">"
  120.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  121.             Name            =   "MS Sans Serif"
  122.             Size            =   8.25
  123.             Charset         =   0
  124.             Weight          =   400
  125.             Underline       =   0   'False
  126.             Italic          =   0   'False
  127.             Strikethrough   =   0   'False
  128.          EndProperty
  129.          BevelWidth      =   1
  130.          Font3D          =   3
  131.          RoundedCorners  =   0   'False
  132.          Outline         =   0   'False
  133.       End
  134.       Begin VB.Label Label2 
  135.          Caption         =   "&Select a function"
  136.          Height          =   255
  137.          Left            =   90
  138.          TabIndex        =   5
  139.          Top             =   120
  140.          Width           =   1275
  141.       End
  142.    End
  143. End
  144. Attribute VB_Name = "frmMailNews"
  145. Attribute VB_GlobalNameSpace = False
  146. Attribute VB_Creatable = False
  147. Attribute VB_PredeclaredId = True
  148. Attribute VB_Exposed = False
  149. Option Explicit
  150. Option Base 1
  151.  
  152. Private Const Iteration = 100
  153.  
  154. Dim IsLoaded         As Integer
  155.  
  156. Dim TimerStartOk     As Integer
  157. Dim TimerCloseOk     As Integer
  158.  
  159. Dim TimerHandle      As Integer
  160. Dim TimerValue       As Long
  161.  
  162. Private Sub cmdNP_Click(Index As Integer)
  163.  
  164.    Call sub_NextPrev(cmb_Function, Index)
  165.  
  166. End Sub
  167.  
  168.  
  169. Private Sub cmb_Function_Click()
  170.    
  171.    If (IsLoaded = False) Then Exit Sub
  172.    
  173.    Call cDisableFI(mdiT2W.Picture1)
  174.    
  175.    txt_Result = ""
  176.    
  177.    DoEvents
  178.    
  179.    Select Case cmb_Function.ListIndex
  180.       Case 0
  181.          Call TestMailNews
  182.    End Select
  183.  
  184.    DoEvents
  185.    Call cEnableFI(mdiT2W.Picture1)
  186.    
  187. End Sub
  188.  
  189.  
  190. Private Sub Form_Activate()
  191.  
  192.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  193.  
  194. End Sub
  195.  
  196. Private Sub Form_Load()
  197.  
  198.    IsLoaded = False
  199.    
  200.    Show
  201.  
  202.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_mailnws.t2w")
  203.    
  204.    IsLoaded = True
  205.    
  206. End Sub
  207.  
  208. Private Sub SSCommand1_Click()
  209.    
  210.    Call cmb_Function_Click
  211.    
  212. End Sub
  213.  
  214. Private Sub TestMailNews()
  215.    
  216.    Dim lResult          As Long
  217.    Dim strResult        As String
  218.    Dim strDisplay       As String
  219.    
  220.    Dim i                As Integer
  221.    
  222.    Dim File1            As String
  223.    Dim File2            As String
  224.    Dim File3            As String
  225.    
  226.    Dim Ptr              As Long
  227.    Dim NextPtr          As Long
  228.    Dim FileName         As String
  229.    Dim TypeOfEncoding   As Integer
  230.    Dim FileState        As Long
  231.    Dim rc               As Integer
  232.    Dim ErrorDecodeOp    As Long
  233.    Dim ErrorMoveOp      As Long
  234.    
  235.    ReDim FileM(1 To 3) As String
  236.  
  237.    strResult = ""
  238.    strDisplay = ""
  239.    
  240.    File1 = T2WFileTest
  241.    File2 = "autoexec.mailnews"
  242.    
  243.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  244.    
  245.    strDisplay = strDisplay & "Encoding (if [ok] then [size of file] else [error]) with " & vbCrLf
  246.    strDisplay = strDisplay & "   header : MNHDR_MAIL" & vbCrLf
  247.    strDisplay = strDisplay & "   linesperfile : 0 (=> single-part)" & vbCrLf
  248.    strDisplay = strDisplay & "   sender : T2WIN-32" & vbCrLf
  249.    strDisplay = strDisplay & "   receiver : The MCR Company" & vbCrLf
  250.    strDisplay = strDisplay & "   subject : Mail & News from TIME TO WIN 32-Bit (...))" & vbCrLf & vbCrLf
  251.    
  252.    FileM(1) = "autoexec.uuencode"
  253.    strDisplay = strDisplay & "      initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  254.    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
  255.    strDisplay = strDisplay & "      shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  256.    
  257.    FileM(2) = "autoexec.xxencode"
  258.    strDisplay = strDisplay & "      initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  259.    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
  260.    strDisplay = strDisplay & "      shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  261.    
  262.    FileM(3) = "autoexec.b64encode"
  263.    strDisplay = strDisplay & "      initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  264.    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
  265.    strDisplay = strDisplay & "      shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  266.    
  267.    File3 = "autoexec.compound"
  268.    strDisplay = strDisplay & "Merge '" & FileM(1) & "' and '" & FileM(2) & "' and '" & FileM(3) & " into '" & File3 & "' is " & cFileMergeExt(FileM(), File3) & vbCrLf & vbCrLf
  269.    
  270.    strDisplay = strDisplay & "Loading '" & File3 & "' in the list of files to be processed" & vbCrLf & vbCrLf
  271.    strDisplay = strDisplay & "   initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  272.    strDisplay = strDisplay & "      loadinlist is " & cMNLoadInList(File3, False) & vbCrLf
  273.    strDisplay = strDisplay & "      countinlist is " & cMNCountInList() & vbCrLf & vbCrLf
  274.    
  275.    strDisplay = strDisplay & "   enumeration of all files in the current list of files :" & vbCrLf & vbCrLf
  276.    If (cMNFirstInList(Ptr) = True) Then
  277.       i = 1
  278.       Do
  279.          rc = cMNWalkInList(Ptr, FileName, TypeOfEncoding, FileState, NextPtr)
  280.          strDisplay = strDisplay & "      file(" & i & ") is '" & FileName & "' (typeofencoding : " & TypeOfEncoding & ", filestate : " & FileState & ")" & vbCrLf
  281.          i = i + 1
  282.          Ptr = NextPtr
  283.       Loop Until rc = False
  284.       strDisplay = strDisplay & vbCrLf
  285.    Else
  286.       strDisplay = strDisplay & "      no files found" & vbCrLf & vbCrLf
  287.    End If
  288.    
  289.    strDisplay = strDisplay & "   shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  290.       
  291.    strDisplay = strDisplay & "   Decoding of all files in the current list of files" & vbCrLf & vbCrLf
  292.    strDisplay = strDisplay & "   initialization is " & IIf(cMNInitialize() = MNRET_OK, "OK", "error") & vbCrLf
  293.    strDisplay = strDisplay & "      loadinlist is " & cMNLoadInList(File3, False) & vbCrLf
  294.    strDisplay = strDisplay & "      countinlist is " & cMNCountInList() & vbCrLf & vbCrLf
  295.    
  296.    If (cMNFirstInList(Ptr) = True) Then
  297.       i = 1
  298.       Do
  299.          rc = cMNWalkInList(Ptr, FileName, TypeOfEncoding, FileState, NextPtr)
  300.          strDisplay = strDisplay & "      file(" & i & ") is '" & FileName & "'" & vbCrLf
  301.          strDisplay = strDisplay & "         rename into 'testmailnews.tst" & i & "' is " & IIf(cMNRenameInList(Ptr, "testmailnews.tst" & i) = MNRET_OK, "OK", "error") & vbCrLf
  302.          strDisplay = strDisplay & "         decode is " & cMNDecodeFromList(Ptr, FileState, ErrorDecodeOp, ErrorMoveOp) & vbCrLf
  303.          strDisplay = strDisplay & "         compare with '" & File2 & "' is " & IIf(cCmpFileContents("testmailnews.tst" & i, File2, False) = -1, "same", "not same") & vbCrLf
  304.          i = i + 1
  305.          Ptr = NextPtr
  306.       Loop Until rc = False
  307.       strDisplay = strDisplay & vbCrLf
  308.    Else
  309.       strDisplay = strDisplay & "      no files found" & vbCrLf & vbCrLf
  310.    End If
  311.    
  312.    strDisplay = strDisplay & "   shutdown is " & IIf(cMNShutdown() = MNRET_OK, "OK", "error") & vbCrLf & vbCrLf
  313.    
  314.    txt_Result = strDisplay
  315.  
  316.    'time the function
  317.  
  318.    TimerHandle = cTimerOpen()
  319.    TimerStartOk = cTimerStart(TimerHandle)
  320.    
  321.    For i = 1 To Iteration
  322.       lResult = cMNInitialize()
  323.       lResult = cMNEncode(File2, FileM(3), FileM(3), MN_B64ENCODED, 0, MNHDR_MAIL, "The MCR", "Company", "Mail & News from TIME TO WIN 32-Bit (B64ENCODED)")
  324.       lResult = cMNShutdown()
  325.    Next i
  326.    
  327.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  328.    
  329.    TimerCloseOk = cTimerClose(TimerHandle)
  330.  
  331. End Sub
  332.