Re: Getting an error in visualbasic.dll
From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 10/25/04
- Next message: Bernie Yaeger: "Re: crystal reports unreleased connections"
- Previous message: John Wadie: "RE: Newbie: Dataset - SQL selection"
- In reply to: Cybert: "Getting an error in visualbasic.dll"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 25 Oct 2004 10:13:38 -0500
Cybert,
What is the complete text of the COMException?
Which line specifically is the COMException happening on?
You can put a Try/Catch around your routine to answer the above two
questions:
Try
> Dim Wilbur As Object
> Dim bIndexLoaded
...
> nCount = nCount + 1
> End While
Catch ex As Exception
Debug.WriteLine("--- the exception begins ---")
Debug.WriteLine(ex)
Debug.WriteLine("--- the exception ends ---")
MessageBox.Show(ex, Application.ProductName)
End Catch
Within your output window you should see the text of the exception, so you
don't need to type what the Message Box is showing you...
Hope this helps
Jay
"Cybert" <john@home-robot.com> wrote in message
news:8aqdnYJVkM6lAufcRVn-3Q@comcast.com...
>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
>
> ---------------------------------------------------------------
>
>
- Next message: Bernie Yaeger: "Re: crystal reports unreleased connections"
- Previous message: John Wadie: "RE: Newbie: Dataset - SQL selection"
- In reply to: Cybert: "Getting an error in visualbasic.dll"
- Messages sorted by: [ date ] [ thread ]