Update of /cvsroot/swebs/swebswebserver/winui/ccCore
In directory sc8-pr-cvs1:/tmp/cvs-serv12370/swebswebserver/winui/ccCore
Added Files:
basMain.bas cCallStack.cls cCore.cls cDebug.cls cEventLog.cls
cNet.cls cPerfMon.cls cPerfMonData.cls cRegistration.cls
cServer.cls cUIInterface.cls cUpdate.cls ccCore.csi ccCore.dll
ccCore.exp ccCore.lib ccCore.lvw ccCore.vbp ccCore.vbw
Log Message:
Ok, now this is a big update, I went ahead with the core/ui split I talked about a while back, this isn't done yet so dont try to use it, just commiting 'just in case'
--- NEW FILE: basMain.bas ---
Attribute VB_Name = "basMain"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public Util As cUtil
Public Translator As cTranslate
Public gCore As cCore
Public Sub Main()
Set Util = New cUtil
Set Translator = New cTranslate
Set gCore = New cCore
gCore.Setup
End Sub
--- NEW FILE: cCallStack.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cCallStack"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom(No Stack)
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Option Base 1
Private Const BUFFER_SIZE As Long = 25
Private Items() As String
Private Index As Long
Public Property Get Count() As Long
Count = Index
End Property
Public Sub Clear()
ReDim Items(BUFFER_SIZE)
Index = 0
End Sub
Public Sub Push(Item As String)
If UBound(Items) = Index + 1 Then
ReDim Preserve Items(Index + BUFFER_SIZE)
End If
Index = Index + 1
Items(Index) = Item
If gCore.Debuger.PerfMon.Enabled = True Then
gCore.Debuger.PerfMon.Add Item
End If
End Sub
Public Function Pop() As String
Dim l As Long
If Index > 0 Then
Pop = Items(Index)
If gCore.Debuger.PerfMon.Enabled = True Then
gCore.Debuger.PerfMon.Remove Items(Index)
End If
Index = Index - 1
End If
If (UBound(Items) - Index) \ BUFFER_SIZE > 1 Then
ReDim Preserve Items(UBound(Items) - BUFFER_SIZE)
End If
End Function
Public Function Peek(lngIndex As Long) As String
If Index > 0 And lngIndex > 0 And lngIndex <= Index Then
Peek = Items(lngIndex)
End If
End Function
Private Sub Class_Initialize()
Clear
End Sub
Private Sub Class_Terminate()
Erase Items
End Sub
--- NEW FILE: cCore.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cCore"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarPath As String
Private mvarVersion As String
Private strLang As String
Public EventLog As cEventLog
Public Registration As cRegistration
Public Update As cUpdate
Public Net As cNet
Public Util As cUtil
Public Debuger As cDebug
Public Server As cServer
Public Property Get Version() As String
Version = mvarVersion
End Property
Public Property Get Path() As String
Path = mvarPath
End Property
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
Set Util = New cUtil
Set Debuger = New cDebug
Set EventLog = New cEventLog
Set Registration = New cRegistration
Set Update = New cUpdate
Set Net = New cNet
Set Server = New cServer
End Sub
Private Sub Class_Terminate()
If Debuger.PerfMon.Enabled = True Then
Debuger.PerfMon.Save mvarPath & "ccperfmon.log"
End If
Set EventLog = Nothing
Set Registration = Nothing
Set Update = Nothing
Set Net = Nothing
Set Util = Nothing
Set Debuger = Nothing
Set Server = Nothing
End Sub
Public Sub Setup()
mvarVersion = Util.GetRegistryString(&H80000002, "SOFTWARE\SWS", "Version")
mvarPath = Util.GetRegistryString(&H80000002, "SOFTWARE\SWS", "AppPath")
mvarPath = IIf(Right$(mvarPath, 1) <> "\", mvarPath & "\", mvarPath)
Debuger.Setup
Server.HTTP.Config.Setup
Server.HTTP.Stats.Setup
Translator.LoadLang "1033", mvarPath & "lang.xml"
Util.LoadUser32 True
Util.InitCommonControlsVB
End Sub
--- NEW FILE: cDebug.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cDebug"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public CallStack As cCallStack
Public PerfMon As cPerfMon
'local variable(s) to hold property value(s)
Private mvarEnabled As Boolean 'local copy
Private mvarDebugLang As Boolean 'local copy
Private mvarDisableSplash As Boolean 'local copy
Private mvarDisableFade As Boolean 'local copy
Private mvarDisableUpdate As Boolean 'local copy
Private mvarDisableTips As Boolean 'local copy
Private mvarDebugMode As Boolean 'local copy
'CSEH: WinUI - Custom(No Stack)
Public Function ErrorReport(strErrMsg As String, strLine As String, strLocation As String) As String
Dim strMessage As String
Dim i As Long
strMessage = String(30, "*") & vbCrLf
strMessage = strMessage & Translator.GetText("WinUI Bug Report - Version:") & " " & gCore.Version & vbCrLf & vbCrLf
strMessage = strMessage & Translator.GetText("Time:") & " (" & Now & ") " & Translator.GetText("Location:") & " (" & strLocation & ") " & Translator.GetText("Line:") & " (" & strLine & ")" & vbCrLf
strMessage = strMessage & Translator.GetText("Message:") & " (" & strErrMsg & ")" & vbCrLf
strMessage = strMessage & Translator.GetText("Call Stack:") & vbCrLf
For i = 1 To CallStack.Count
strMessage = strMessage & Chr(9) & CallStack.Peek(i) & vbCrLf
Next
strMessage = strMessage & vbCrLf & Translator.GetText("Please see http://swebs.sf.net for information on this error.") & vbCrLf
strMessage = strMessage & String(30, "*") & vbCrLf
Open gCore.Path & "WinUI_ErrLog.log" For Append As 1
Print #1, strMessage
Close 1
ErrorReport = gCore.Path & "WinUI_ErrLog.log"
End Function
Public Property Let DebugMode(ByVal vData As Boolean)
mvarDebugMode = vData
End Property
Public Property Get DebugMode() As Boolean
DebugMode = mvarDebugMode
End Property
Public Sub KillUpdate()
Util.SaveRegistryString &H80000002, "SOFTWARE\SWS", "UpdateEnabled", "False"
mvarDisableUpdate = True
End Sub
Public Property Let DisableUpdate(ByVal vData As Boolean)
mvarDisableUpdate = vData
End Property
Public Property Get DisableUpdate() As Boolean
DisableUpdate = mvarDisableUpdate
End Property
Public Property Let DebugLang(ByVal vData As Boolean)
mvarDebugLang = vData
End Property
Public Property Get DebugLang() As Boolean
DebugLang = mvarDebugLang
End Property
Public Property Let Enabled(ByVal vData As Boolean)
mvarEnabled = vData
End Property
Public Property Get Enabled() As Boolean
Enabled = mvarEnabled
End Property
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
Set CallStack = New cCallStack
Set PerfMon = New cPerfMon
End Sub
Private Sub Class_Terminate()
Set CallStack = Nothing
Set PerfMon = Nothing
End Sub
Public Sub Setup()
mvarDisableUpdate = IIf(LCase$(Util.GetRegistryString(&H80000002, "SOFTWARE\SWS", "UpdateEnabled")) = "false", True, False)
End Sub
--- NEW FILE: cEventLog.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cEventLog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Attribute VB_Ext_KEY = "Member0" ,"cCommonDialog"
'CSEH: WinUI - Custom(No Stack)
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Private blnEnabled As Boolean
Private blnChanged As Boolean
Private strEventLog As String
Public Property Get Log() As String
blnChanged = False
Log = strEventLog
End Property
Public Property Get Changed() As Boolean
Changed = blnChanged
End Property
Public Sub AddEvent(ByVal strLocation As String, ByVal strEvent As String)
Attribute AddEvent.VB_UserMemId = 0
If blnEnabled = True Then
blnChanged = True
strEventLog = strEventLog & "(" & Format$(Now, "hh:mm:ss") & ") " & strLocation & ": " & strEvent & vbCrLf
Else
strEventLog = ""
End If
End Sub
Public Property Let Enabled(ByVal vData As Boolean)
blnEnabled = vData
End Property
Public Property Get Enabled() As Boolean
Enabled = blnEnabled
End Property
--- NEW FILE: cNet.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cNet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'PageSource
Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetOpenUrl Lib "wininet.dll" Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal sURL As String, ByVal sHeaders As String, ByVal lHeadersLength As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function InternetReadFile Lib "wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
'LaunchURL API
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'IsOnline API
Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" Alias "InternetGetConnectedStateExA" (lpdwFlags As Long, lpszConnectionName As Long, dwNameLen As Long, ByVal dwReserved As Long) As Long
'PageSource
Private Const IF_NO_CACHE_WRITE = &H4000000
Private Const BUFFER_LEN = 256
Public Sub LaunchURL(ByVal strURL As String)
Call ShellExecute(0, vbNullString, strURL, vbNullString, vbNullString, vbNormalFocus)
End Sub
Public Function PageSource(ByVal sURL As String, Optional ByVal strHeaders As String = "") As String
Dim sBuffer As String * BUFFER_LEN, iResult As Integer, sData As String
Dim hInternet As Long, hSession As Long, lReturn As Long
Dim lngHeaderLen As Long
lngHeaderLen = Len(strHeaders)
'get the handle of the current internet connection
hSession = InternetOpen("User-Agent: SWEBS WinUI " & gCore.Version & " <ad...@im...>", 1, vbNullString, vbNullString, 0)
'get the handle of the url
If hSession Then hInternet = InternetOpenUrl(hSession, sURL, strHeaders, lngHeaderLen, IF_NO_CACHE_WRITE, 0)
'if we have the handle, then start reading the web page
If hInternet Then
'get the first chunk & buffer it.
iResult = InternetReadFile(hInternet, sBuffer, BUFFER_LEN, lReturn)
sData = sBuffer
'if there's more data then keep reading it into the buffer
Do While lReturn <> 0
iResult = InternetReadFile(hInternet, sBuffer, BUFFER_LEN, lReturn)
sData = sData + Mid$(sBuffer, 1, lReturn)
DoEvents
Loop
End If
'close the URL
iResult = InternetCloseHandle(hInternet)
PageSource = sData
End Function
Public Property Get IsOnline() As Boolean
Dim lNameLen As Long
Dim lRetVal As Long
Dim lConnectionFlags As Long
Dim LPTR As Long
Dim lNameLenPtr As Long
Dim sConnectionName As String
sConnectionName = Space$(256)
lNameLen = 256
LPTR = StrPtr(sConnectionName)
lNameLenPtr = VarPtr(lNameLen)
lRetVal = InternetGetConnectedStateEx(lConnectionFlags, ByVal LPTR, ByVal lNameLen, 0&)
IsOnline = (lRetVal <> 0)
End Property
--- NEW FILE: cPerfMon.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cPerfMon"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom(No Stack)
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private mCol As Collection
Private curFreq As Currency
Private strPerfLog As String
Private mvarEnabled As Boolean
Private lngCallCount As Long
Private curTotalTime As Currency
Public Property Let Enabled(ByVal vData As Boolean)
mvarEnabled = vData
End Property
Public Property Get Enabled() As Boolean
Enabled = mvarEnabled
End Property
Public Sub Add(strFunction As String)
Dim tData As cPerfMonData
Dim curStartTime As Currency
Set tData = New cPerfMonData
tData.Name = strFunction
QueryPerformanceCounter curStartTime
tData.StartTime = curStartTime
tData.StopTime = 0
mCol.Add tData, strFunction
Set tData = Nothing
End Sub
Public Sub Remove(strFunction As String)
Dim tData As cPerfMonData
Dim curExecTime As Currency
Dim curStopTime As Currency
Dim strFixedFunction As String * 50
Set tData = mCol.Item(strFunction)
QueryPerformanceCounter curStopTime
tData.StopTime = curStopTime
curExecTime = 1000 * (tData.StopTime - tData.StartTime) / curFreq
curTotalTime = curTotalTime + curExecTime
lngCallCount = lngCallCount + 1
strFixedFunction = strFunction
strPerfLog = strPerfLog & "Function: " & strFixedFunction & String(2, Chr(9)) & "Execution Time: " & Space(18 - Len(Format(Str(curExecTime), "#.0000"))) & Format(Str(curExecTime), "#.0000") & vbCrLf
mCol.Remove strFunction
Set tData = Nothing
End Sub
Public Function Save(strFile As String) As Boolean
strPerfLog = strPerfLog & "Statistics: Call Count: " & lngCallCount & " Average Execution Time: " & (curTotalTime / lngCallCount) & vbCrLf & String(103, "*") & vbCrLf
Open strFile For Append As 1
Print #1, strPerfLog
Close 1
Save = True
End Function
Private Sub Class_Initialize()
Set mCol = New Collection
QueryPerformanceFrequency curFreq
strPerfLog = String(103, "*") & vbCrLf & "Application Started: " & Now & vbCrLf
End Sub
Private Sub Class_Terminate()
Set mCol = Nothing
End Sub
--- NEW FILE: cPerfMonData.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cPerfMonData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom(No Stack)
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarStartTime As Currency
Private mvarStopTime As Currency
Private mvarName As String
Public Property Let Name(ByVal vData As String)
mvarName = vData
End Property
Public Property Get Name() As String
Name = mvarName
End Property
Public Property Let StopTime(ByVal vData As Currency)
mvarStopTime = vData
End Property
Public Property Get StopTime() As Currency
StopTime = mvarStopTime
End Property
Public Property Let StartTime(ByVal vData As Currency)
mvarStartTime = vData
End Property
Public Property Get StartTime() As Currency
StartTime = mvarStartTime
End Property
--- NEW FILE: cRegistration.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cRegistration"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public Property Get IsRegistered() As Boolean
Dim strResult As String
strResult = Util.GetRegistryString(&H80000002, "SOFTWARE\SWS", "RegID")
If strResult <> "" Then
IsRegistered = True
Else
IsRegistered = False
End If
'lets default to yes either way until somebody gets around to writing &%$#@*& script
IsRegistered = True
End Property
Public Sub Start() 'TODO: Fix Me! - This is *not* UI/Core split
'Dim lngResult As Long
' lngResult = MsgBox(Translator.GetText("Would you like to register your software? It's fast and Free!\r\rProduct registration is used to provide the best possible service, products, and support for our users.\rWe will not contact you nor will we sell or give away any of your information.\r\rWould you like to register now?"), vbQuestion + vbYesNo + vbApplicationModal)
' If lngResult = vbYes Then
' Load frmRegistration
' frmRegistration.Show vbModal
' End If
End Sub
Public Sub Renew()
'this is what should get called:
'PageSource "http://swebs.sf.net/register/regupdate.php?email=" & UrlEncode(GetRegistryString(&H80000002, "SOFTWARE\SWS", "RegID")) & "&ver=" & UrlEncode(WinUI.Version)
DoEvents
End Sub
--- NEW FILE: cServer.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cServer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public HTTP As cHTTP
'CSEH: WinUI - Custom(No Stack)
Private Sub Class_Initialize()
Set HTTP = New cHTTP
End Sub
Private Sub Class_Terminate()
Set HTTP = Nothing
End Sub
--- NEW FILE: cUIInterface.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cUIInterface"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
Public Property Get DefInstance() As cCore
Set DefInstance = gCore
End Property
--- NEW FILE: cUpdate.cls ---
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cUpdate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'CSEH: WinUI - Custom
'***************************************************************************
'
' SWEBS/WinUI
'
' Copyright (c) 2003 Adam Caudill.
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation; either version 2 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with this program; if not, write to the Free Software
' Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'***************************************************************************
Option Explicit
'local variable(s) to hold property value(s)
Private mvarIsAvailable As Boolean 'local copy
Private mvarVersion As String 'local copy
Private mvarReleaseDate As String 'local copy
Private mvarInfoURL As String 'local copy
Private mvarDownloadURL As String 'local copy
Private mvarDescription As String 'local copy
Private mvarUpdateLevel As String 'local copy
Private mvarFileSize As Long 'local copy
Public Sub Check()
Dim strData As String
Dim strNewVer() As String
Dim strCurVer() As String
Dim i As Long
If gCore.Debuger.DisableUpdate <> True Then
If gCore.Net.IsOnline = True Then
strData = Replace(gCore.Net.PageSource("http://swebs.sf.net/upgrade.xml"), vbLf, vbCrLf)
End If
If InStr(1, strData, "Server at swebs.sourceforge.net Port 80") = 0 And strData <> "" Then
gCore.EventLog.AddEvent "SWEBS_WinUI_DLL.cUpdate.Check", "Update Data Found, Processing."
mvarReleaseDate = Util.GetTaggedData(strData, "Date")
mvarDescription = Util.GetTaggedData(strData, "Description")
mvarDownloadURL = Util.GetTaggedData(strData, "DownloadURL")
mvarInfoURL = Util.GetTaggedData(strData, "InfoURL")
mvarVersion = Util.GetTaggedData(strData, "Version")
mvarUpdateLevel = Util.GetTaggedData(strData, "UpgradeLevel")
mvarFileSize = Val(Util.GetTaggedData(strData, "FileSize"))
'check to see if this is newer
'this is a bad way to do things, needs to be fixed, again
strNewVer() = Split(mvarVersion, ".")
strCurVer() = Split(gCore.Version, ".")
For i = 0 To UBound(strNewVer)
If Val(strNewVer(i)) > Val(strCurVer(i)) Then
mvarIsAvailable = True
gCore.EventLog.AddEvent "SWEBS_WinUI_DLL.cUpdate.Check", "Update Available. Old Version: " & gCore.Version & "; New Version: " & gCore.Update.Version
End If
Next
ElseIf mvarIsAvailable = True Then
gCore.EventLog.AddEvent "SWEBS_WinUI_DLL.cUpdate.Check", "Update status already true."
Else
mvarIsAvailable = False
gCore.EventLog.AddEvent "SWEBS_WinUI_DLL.cUpdate.Check", "No update data or update file not found."
End If
End If
End Sub
Public Property Get FileSize() As Long
FileSize = mvarFileSize
End Property
Public Property Get UpdateLevel() As String
UpdateLevel = mvarUpdateLevel
End Property
Public Property Get Description() As String
Description = mvarDescription
End Property
Public Property Get DownloadURL() As String
DownloadURL = mvarDownloadURL
End Property
Public Property Get InfoURL() As String
InfoURL = mvarInfoURL
End Property
Public Property Get ReleaseDate() As String
ReleaseDate = mvarReleaseDate
End Property
Public Property Get Version() As String
Version = mvarVersion
End Property
Public Property Get IsAvailable() As Boolean
IsAvailable = mvarIsAvailable
End Property
--- NEW FILE: ccCore.csi ---
[History]
B0=ccCore/cPerfMon/Class_Terminate
B1=ccCore/cPerfMon
B3=ccCore/cDebug/Enabled
B4=ccCore/cDebug
--- NEW FILE: ccCore.dll ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccCore.exp ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccCore.lib ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccCore.lvw ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: ccCore.vbp ---
Type=OleDll
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation
Reference=*\G{09964172-0145-439E-9EA3-8CE311269AF1}#6.0#0#..\..\..\swebswebserver\winui\ccHTTP\ccHTTP.dll#
Reference=*\G{0C5C47CC-E5CB-4896-A020-0350E9EF2D64}#5.0#0#..\..\..\swebswebserver\winui\ccUtil\ccUtil.dll#
Reference=*\G{44004330-CB01-44A6-9375-50C0E8281B75}#1.0#0#..\..\..\swebswebserver\winui\ccTranslator\ccTranslator.dll#
Module=basMain; basMain.bas
Class=cUpdate; cUpdate.cls
Class=cServer; cServer.cls
Class=cRegistration; cRegistration.cls
Class=cPerfMonData; cPerfMonData.cls
Class=cPerfMon; cPerfMon.cls
Class=cNet; cNet.cls
Class=cEventLog; cEventLog.cls
Class=cDebug; cDebug.cls
Class=cCallStack; cCallStack.cls
Class=cUIInterface; cUIInterface.cls
Class=cCore; ..\..\..\swebswebserver\winui\ccCore\cCore.cls
Startup="Sub Main"
HelpFile=""
Title="ccCore"
ExeName32="ccCore.dll"
Command32=""
Name="ccCore"
HelpContextID="0"
CompatibleMode="1"
CompatibleEXE32="ccCore.dll"
MajorVer=1
MinorVer=0
RevisionVer=3
AutoIncrementVer=1
ServerSupportFiles=0
VersionCompanyName="Imspire.com"
CompilationType=-1
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=1
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
DebugStartupOption=0
[MS Transaction Server]
AutoRefresh=1
--- NEW FILE: ccCore.vbw ---
basMain = 0, 0, 0, 0, C
cUpdate = 0, 0, 0, 0, C
cServer = 0, 0, 0, 0, C
cRegistration = 0, 0, 0, 0, C
cPerfMonData = 0, 0, 0, 0, C
cPerfMon = 0, 0, 0, 0, C
cNet = 0, 0, 0, 0, C
cEventLog = 0, 0, 0, 0, C
cDebug = 0, 0, 0, 0, C
cCallStack = 0, 0, 0, 0, C
cUIInterface = 0, 0, 0, 0, C
cCore = 0, 0, 0, 0, C
|