From: Darko K. <da...@ho...> - 2004-02-16 15:32:56
|
Hello all... I made some minor modifications to loader code.. Darko '--------------------------------------------------------------------------- ---------- ' CodeBlue/IM Modular Loader v1.0 ' ' Date Coder Description ' ========= =========== ============================================================== ' 02-14-04 Wimz Initial Creation ' 02-16-04 Darko Some performance tweaks ' ' ' ' Modular loader for CodeBlue/IM ' ' Checks for updates of the CodeBlue/IM components at startup, downloads and installs ' updates if available and launches the program afterwards. Using modular code, we ' can save loads of time and effort telling everyone there's a new update to be ' downloaded, especially while still in heavy development. ' '--------------------------------------------------------------------------- ---------- Option Explicit 'We have to declare every variable Option Compare Text 'Default compare option is now text (not case sensitive) instead of binary Private Sub Main() '--[ Variable declaration ]--------------------------------------------------- Dim szErrMissingMSG As String Dim szErrMissingTtl As String '--[ Display the form ]------------------------------------------------------- frmSplash.Show '--[ Setup basic error handeling ]-------------------------------------------- On Error Resume Next '--[ Load Localised Messages ]------------------------------------------------ szErrMissingMSG = VB.LoadResString(1900) szErrMissingTtl = VB.LoadResString(1901) '--[ Catch Localisation Errors ]---------------------------------------------- If LenB(szErrMissingMSG) = 0 Then 'Note that LenB() is faster for checking if variable is empty szErrMissingTtl = "CodeBlue/IM - Critical Error" szErrMissingMSG = "Core components could not be found; please re-install" + vbNewLine + _ " CodeBlue/IM. CodeBlue/IM will now be terminated." End If '--[ Check if components exist ]---------------------------------------------- If LenB(FileSystem.Dir(App.Path & "\" & "cbupwiz.dll")) = 0 Or _ LenB(FileSystem.Dir(App.Path & "\" & "cbimapi.dll")) = 0 Then ' --[ Display error & Exit ]------------------------------------------ MsgBox szErrMissingMSG, vbCritical, szErrMissingTtl End End If '--[ Check for updates ]------------------------------------------------------ Dim ctlCBWUD As Object Set ctlCBWUD = CreateObject("CBUpWiz.modUpdate") If ctlCBWUD.StartUpdate = True Then End End If Set ctlCBWUD = Nothing '--[ Start CodeBlue Messenger ]----------------------------------------------- Dim ctlCBAPI As Object Set ctlCBAPI = CreateObject("CBIMApi.CodeBlue") frmSplash.Hide ctlCBAPI.StartUp Set ctlCBAPI = Nothing '--[ Exit to Windows ]-------------------------------------------------------- End End Sub |
From: W. B. / F. N. <wi...@fa...> - 2004-02-16 17:01:18
|
Looks okay to me :-) Though I think we should take out the object =3D Nothing code too, as = Windows will handle it for us when terminating the program; it saves = some speed too, although it will require a bit more memory to run (just = some pointer space, nothing big). If you really want to make the string comparisions fast, you'd better = check the size of the string from memory as the only things that are = beeing checked at the moment are if a string contains something. Just = peek the size of the string, directly before the string in memory. Wimz ----- Original Message -----=20 From: Darko Kenda=20 To: cb...@li...=20 Sent: Monday, February 16, 2004 4:29 PM Subject: RE: [Cbm-cvs] Preview-Source : modLoader.BAS [CodeBlue/IM = Loader] Hello all... I made some minor modifications to loader code.. =20 Darko =20 =20 =20 = '------------------------------------------------------------------------= ------------- ' CodeBlue/IM Modular Loader v1.0 ' ' Date Coder Description ' =3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ' 02-14-04 Wimz Initial Creation ' 02-16-04 Darko Some performance tweaks ' ' ' ' Modular loader for CodeBlue/IM ' ' Checks for updates of the CodeBlue/IM components at startup, = downloads and installs ' updates if available and launches the program afterwards. Using = modular code, we ' can save loads of time and effort telling everyone there's a new = update to be ' downloaded, especially while still in heavy development. ' = '------------------------------------------------------------------------= ------------- =20 Option Explicit 'We have to declare every variable Option Compare Text 'Default compare option is now text (not case = sensitive) instead of binary =20 Private Sub Main() '--[ Variable declaration = ]--------------------------------------------------- Dim szErrMissingMSG As String Dim szErrMissingTtl As String =20 '--[ Display the form = ]------------------------------------------------------- frmSplash.Show =20 '--[ Setup basic error handeling = ]-------------------------------------------- On Error Resume Next =20 '--[ Load Localised Messages = ]------------------------------------------------ szErrMissingMSG =3D VB.LoadResString(1900) szErrMissingTtl =3D VB.LoadResString(1901) =20 '--[ Catch Localisation Errors = ]---------------------------------------------- If LenB(szErrMissingMSG) =3D 0 Then 'Note that LenB() is = faster for checking if variable is empty szErrMissingTtl =3D "CodeBlue/IM - Critical Error" szErrMissingMSG =3D "Core components could not be found; = please re-install" + vbNewLine + _ " CodeBlue/IM. CodeBlue/IM will now be = terminated." End If =20 '--[ Check if components exist = ]---------------------------------------------- If LenB(FileSystem.Dir(App.Path & "\" & "cbupwiz.dll")) =3D 0 = Or _ LenB(FileSystem.Dir(App.Path & "\" & "cbimapi.dll")) =3D 0 = Then ' --[ Display error & Exit = ]------------------------------------------ MsgBox szErrMissingMSG, vbCritical, szErrMissingTtl End End If =20 '--[ Check for updates = ]------------------------------------------------------ Dim ctlCBWUD As Object Set ctlCBWUD =3D CreateObject("CBUpWiz.modUpdate") If ctlCBWUD.StartUpdate =3D True Then End End If Set ctlCBWUD =3D Nothing =20 '--[ Start CodeBlue Messenger = ]----------------------------------------------- Dim ctlCBAPI As Object Set ctlCBAPI =3D CreateObject("CBIMApi.CodeBlue") frmSplash.Hide ctlCBAPI.StartUp Set ctlCBAPI =3D Nothing =20 '--[ Exit to Windows = ]-------------------------------------------------------- End End Sub |
From: W. B. / F. N. <wi...@fa...> - 2004-02-16 18:18:12
|
Currently there are 3 codeblue servers which will come online within the = next 24h (or as soon as I'm done with my protocol update in the server = script). These servers are : msgsvr1.us.cbim.biz ( MAE-EAST) msgsvr2.us.cbim.biz ( MAE-WEST) msgsvr1.nl.cbim.biz ( AMS-IX / GN-IX) Apart from these hosts, we have : www.cbim.biz New webspace for codeblue (apart from sourceforge) updates.cbim.biz Will provide early updates apart from SourceForge to = increase distribution. while developing, you might want to include some speed checks so a = client can connect to the fastest server available for him. The servers = are already reachable by IPv6 too, however I haven't assigned = hostnames/aliasses to the IPv6 IPs as we're still writing for IPv4 only = at the moment. Wim |