Results 1 to 2 of 2

Thread: iDispatch variable cause thinBasic crash

  1. #1

    Exclamation iDispatch variable cause thinBasic crash

    Hi,

    in this minimal example, we can see that thinBasic crash at the end of script. At first I thought it is because some variable was not destroyed before the end, but thinDebug shows that it isn't the case.

    uses "console"
    
    string strComputer      = "."
    
    iDispatch objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    
    if IsComObject(objWMIService) Then
    
      iDispatch colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Volume")
    
      if IsComObject(colItems) Then
    
        iDispatch objItem
    
        For nItem as long = 1 to colItems.Count
    
          objItem = colItems.ItemIndex(nItem - 1) '---First item in collectins starts at 0
    
          printl $tab, "Name..............: ", objItem.Name
    
          objItem = Nothing
    
        Next
    
        colItems = Nothing
    
      Else
    
      end If
    
      objWMIService = Nothing
    
    Else
    
    end If
    
    Printl "Press a key to end."
    
    WaitKey
    
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,814
    Rep Power
    10
    Ciao,

    yes I confirm it crashed at the end.
    I think it is something related to OLE32 de-initialize
    Will check

    Thanks for reporting
    Eros


    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">	<System>
    		<Provider Name="Application Error" /> 
    		<EventID Qualifiers="0">1000</EventID> 
    		<Version>0</Version> 
    		<Level>2</Level> 
    		<Task>100</Task> 
    		<Opcode>0</Opcode> 
    		<Keywords>0x80000000000000</Keywords> 
    		<TimeCreated SystemTime="2020-01-25T10:41:44.9695929Z" /> 
    		<EventRecordID>24657</EventRecordID> 
    		<Correlation /> 
    		<Execution ProcessID="0" ThreadID="0" /> 
    		<Channel>Application</Channel> 
    		<Computer>EOlmi-HPEB8540W</Computer> 
    		<Security /> 
    	</System>
    	<EventData>
    		<Data>thinBasic.exe</Data> 
    		<Data>1.11.3.0</Data> 
    		<Data>00003039</Data> 
    		<Data>OLEAUT32.dll</Data> 
    		<Data>10.0.19041.1</Data> 
    		<Data>d273657c</Data> 
    		<Data>c0000005</Data> 
    		<Data>0001eae4</Data> 
    		<Data>1874</Data> 
    		<Data>01d5d36c0691fb7b</Data> 
    		<Data>C:\thinBasic\thinBasic.exe</Data> 
    		<Data>C:\WINDOWS\System32\OLEAUT32.dll</Data> 
    		<Data>4e8fd6b1-e8ef-47eb-89f4-443540c8ce3d</Data> 
    		<Data /> 
    		<Data /> 
    	</EventData>
    </Event>
    
    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

Similar Threads

  1. thinBasic server crash
    By ErosOlmi in forum Web and Forum
    Replies: 3
    Last Post: 07-10-2010, 09:02
  2. New in next thinBasic: FOR with on-the-fly variable definition
    By ErosOlmi in forum thinBasic vaporware
    Replies: 16
    Last Post: 09-07-2008, 09:39
  3. Comm_Recv causes thinBasic to crash
    By Bevan in forum COMM (Serial communication)
    Replies: 23
    Last Post: 08-08-2007, 10:59

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
  •