Results 1 to 9 of 9

Thread: Registry problem again

  1. #1
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Registry problem again

    Hello Eros,

    The old registry bug has appeared again ???, Registry_GetAllKeys seems stuck in a loop.

    I am using Version 1.9.15.0

    Uses "UI","COMM","REGISTRY"
    ' -- ID numbers of controls
    
    
    Global sComPorts(200)   As String
    
    
    Function TBMain()
    
    
     GetComports(10)
    
    
    End Function
     
    Function GetComPorts(CBHNDL As DWord)
      Local N,M    As DWord
      Local nIdx   As DWord
      Local sBuffer As String
      Local sPorts() As String
      
      If Registry_PathExists("HKEYLM", "hardware\devicemap\serialcomm") Then
        sBuffer = Registry_GetAllKeys("HKEYLM", "hardware\devicemap\serialcomm")   '<<<<< Stuck in loop (again) ???
        Split(Buffer,$CRLF,Ports)
        If UBound(sPorts) <> UBound(sComPorts) Then
            ReDim sComPorts(UBound(sPorts))
            For n = 1 To UBound(sPorts)
              sComPorts(n) = Remain$(sPorts(n),"=")
            Next
        EndIf
      EndIf
    End Function
    
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735
    Hi Mike,

    I can confirm the problem.

    Here is another example to replicate, on PC without COM ports (+advantage of killability with Ctrl-C in console):
    Uses "Registry", "Console"
          
    Function TBMain()
     
      $RegPath = "hardware\devicemap\video" 
      If Registry_PathExists("HKEYLM", $RegPath) Then
        Print "About to scan for keys..."
        String sBuffer = Registry_GetAllKeys("HKEYLM", $RegPath)
        PrintL "DONE" In 10 ' -- Does not happen now, thanks to stuck behavior
      Else  
        PrintL "You need to adjust the $RegPath to something existing on your PC" In 12    
      End If
      
      PrintL
      PrintL "Press any key to quit..."
      WaitKey          
     
    End Function
    
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735
    Mike,

    I prepared a hotfix for you. Please use the attached thinBASIC_RegistryFix module, below is usage:
    Uses "Registry", "RegistryFix", "Console"
          
    Function TBMain()
     
      $RegPath = "hardware\devicemap\video" 
      If Registry_PathExists("HKEYLM", $RegPath) Then
        Print "About to scan for keys..."
        String sBuffer = RegistryFix_GetAllKeys("HKEYLM", $RegPath) ' -- This is the only function in RegistryFix "module"
        PrintL "DONE" In 10 
        PrintL sBuffer
      Else  
        PrintL "You need to adjust the $RegPath to something existing on your PC" In 12    
      End If
      
      PrintL
      PrintL "Press any key to quit..."
      WaitKey          
     
    End Function
    
    Let me know if it helps. Of course, fix directly in Registry module will be better - if my fix helps, I will guide Eros further.


    Petr
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,813
    Rep Power
    10
    Thanks Petr.

    Here attached a semi official fix of original module.
    Please download and substitute the one you have into \thinBasic\Lib\

    Let me know if it works.

    Ciao
    Eros

    PS: Back from my holidays I think I will publish many of the thinBasic modules as sources into Github at https://github.com/ErosOlmi/ThinBASIC_On_GitHub
    Attached Files Attached Files
    Last edited by ErosOlmi; 14-07-2015 at 22:27.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160
    Thanks guys, it works great.

    Eros I haven't done any work with TB for a while, i've been playing with python and discovering its a horrible language if your used to fixed data types.

    thanks.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,146
    Rep Power
    735
    Hi Mike,

    I've been using Ruby at work extensively lately - some inspiring stuff I would like to bring to ThinBASIC, but the absence of types... it is not ellegant, it is sheer horror

    Eros, I did minor cleanup of the thinRegistry now, let the GitHub party begins . I also added thinCore.inc there, so it is possible to checkout repo and compile immediately.


    Petr
    Last edited by Petr Schreiber; 14-07-2015 at 23:25.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    Member
    Join Date
    Nov 2012
    Location
    Missouri, USA
    Posts
    113
    Rep Power
    29
    Eros,

    Please clear up something for me. I have a way to tell a file's version. The old thinBasic_Registry.dll was 1.9.15.0 and yours is 1.916.0. Does thinBasic check version compatability? The other question is the thinBasic_Registry.dll at your link about above is two days old, version 1.9.15.0, and over 47k in size. Is yours 17,408 because the one at the link has 'large chunks of commented out code?' BTW Yours is the same size as the one I just replaced.

    Bill
    Last edited by Billbo; 16-07-2015 at 17:33.

  8. #8
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,813
    Rep Power
    10
    This was a quick fix of the module. I had 1.9.16.0 ongoing so I've used that version number to publish this module.
    Module version is not important, the only important version is the version of Core module (thinCore.dll)

    Regarding sources at Github, last update was performed by Petr, not by me. I will update when back from holidays.
    Regarding size, my version of module DLLs are always compressed by UPX so when I will update Github size will be much smaller.

    Anyway from September 2015 I will start publishing almost all thinBasic modules sources into Github.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #9
    Member
    Join Date
    Nov 2012
    Location
    Missouri, USA
    Posts
    113
    Rep Power
    29
    Eros,

    Thanks for the speedy reply. Watch out for the water shortage in California. The state settled with Tom Selleck for stealing it. He had to pay several thousand dollars.

    Have a nice vacation.

    Bill

Similar Threads

  1. Registry Repair Programs
    By GSAC3 in forum General
    Replies: 1
    Last Post: 24-07-2009, 10:25
  2. Registry entry to the thinBasic folder?
    By Michael Hartlef in forum thinBasic General
    Replies: 2
    Last Post: 18-12-2006, 15:04

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •