Getting an error in visualbasic.dll

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Cybert (john_at_home-robot.com)
Date: 10/23/04


Date: Sat, 23 Oct 2004 11:13:36 -0700

I just installed Microsoft Visual Basic .NET and wrote a very simple program
that references a .tlb file called "Wilbur". The first time I ran the
program below everything worked fine. But subsequent attempts to run it are
causing the following error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in microsoft.visualbasic.dll

I've contacted the author of Wilbur and he said that he's never tested his
program within the .NET framework. His program works fine under older
versions of VB so I'm wondering how the .NET framework is different. I know
it's not much to go on, but based on the code below (which has a few very
obvious problems that I'll correct tomorrow) is there ANYTHING that sticks
out as a potential .NET issue? Maybe I'm starting the search too soon after
the Update... I'll try adding in a small delay. Thanks for any
suggestions.

NOTE: I'm a game designer and I'm trying to use Wilbur to write a little
search program. I'm obviously NOT a programmer, but this is a very simple
tool that will save me a TON of time every day if I can get it working.

------------------ (BUTTON CLICK EVENT ------------------

        Dim Wilbur As Object
        Dim bIndexLoaded
        'wilbur and bIndexLoaded are global
        'if an index is already open, then close it
        If bIndexLoaded Then
            Wilbur.Quit()
            bIndexLoaded = False
        End If
        Wilbur = CreateObject("Wilbur.FileIndex")
        bIndexLoaded = True
        If Not Wilbur.OpenIndex("C:\TestWilburIndex.Wil") Then
            MsgBox("Could not load index")
        End If

        Wilbur.Update(900000)

        Dim searchResults As Object
        Dim search2 As Object
        ' get the list of files containing the phrase entered
        ' in the Text1 field
        searchResults = Wilbur.SearchFor("test")
        ' Extract the names from the list and use them
        ' to fill a list box
        Dim bResult As Boolean
        Dim nCount As Integer
        nCount = 0
        bResult = searchResults.setToStart
        While bResult
            Dim lastMod As Date
            lastMod = searchResults.getModifiedDate
            List1.Items.Add(searchResults.getPath)
            bResult = searchResults.setToNext
            nCount = nCount + 1
        End While

---------------------------------------------------------------


Quantcast