Using tom interface to search a RichTextBox

dotnet framework


  • 1. COM from VB.Net problem "Property evaluation failed"
    Hi. I've successfully used methods in VB6 COM dlls before from a VB.Net class library but I'm having grief with a DLL I've never used before. After creating a new instance of the COM class with "Dim myCom As New XXX.xClass" (which takes a while to execute), I'm putting a quick watch on the myCom object and all the variables in the object have the value "Property evaluation failed". Most of the variables in the VB6 dll are of type "variant" but even the variables of type short and double have this failed evaluation value. When I try to assign a value to any of these properties/variables, I get a type mismatch error. By the way, I do get intellisense for the variable names so I have registered the COM dll properly. Can anyone help me narrow down the cause of this problem?
  • 2. COM Interop with IErrorInfo not working with Web Service
    Hello, I have an in-process COM object (implemented with ATL) that I am using from an ASP.NET web service via COM Interop. The COM interface supports IErrorInfo. When making a call from the web service that throws an exception, the caught exception just has a generic "Exception occurred" message with the thrown HRESULT value in it. However, when calling the COM interface from a C# command line program I get the correct error information populated by the COM object in the caught exception. Any ideas why the exception handling behavior is different between using COM Interop from a web service vs. a command line C# program? These are both implemented in VS2005, the COM object is implemented in VC6. Incidentally, I get good error messages calling the COM object from VB6 also. Thanks in advance for any ideas you can give me. Regards, Cameron
    Hi, When I expose a enum to COM, the name of the enumeration is automatically added in prefix to the names of the elements of the exposed enumeration. Sample: [ComVisible(true)] [GuidAttribute("xxxx")] public enum EnumerationName { [DispId(0)] Element1, [DispId(1)] Element2, ... Expose: Enumeration named: EnumerationName Element1 named : EnumerationName_Element1 Element2 named : EnumerationName_Element2 ... I want to have control on the prefix added to the Elements Names. How can I do it ??? Thank's for your help

Using tom interface to search a RichTextBox

Postby Just Me » Sun, 15 Aug 2004 02:38:30 GMT

I want to search a RichTextBox using a Regular Expression.

I've tried it using the tom interface but can't make it work.
That is, it works for whole words and for case but not for regular

Below is a little of the code.

Thanks for any help.

Dim IDocument As tom.ITextDocument =


If chkWholeWords.Checked Then lFlags = Flags.MatchWord

If chkMatchCase.Checked Then lFlags = lFlags Or Flags.MatchCase

If chkRegularExpressions.Checked Then lFlags = lFlags Or

Select Case aFindType


        lSearchRange = GetCtlEdit(Me).TxtRangeAll

        lintFoundPos = FindText(lSearchRange,
        cboFindStr.Text, -lSearchRange.StoryLength, lFlags)



Private Function FindText(ByRef aRange As tom.ITextRange, ByVal aFindString
As String, ByVal aCount As Integer, ByVal aFlags As Integer) As Integer

If aCount = 0 Then

    FindText = 0


    If aCount < 0 Then

        FindText = aRange.FindTextEnd(aFindString, aCount, aFlags)

        If FindText > 0 Then aRange.Start = aRange.End - FindText


        FindText = aRange.FindTextStart(aFindString, aCount, aFlags)

        If FindText > 0 Then aRange.End = aRange.Start + FindText

    End If

End If

End Function

Similar Threads:

1.Adding a File Search using a Registry Search value for the Folder property

Using Setup and Deployment project in Visual Studio 2005, I'm trying
to find the version on a file as a launch condition, but first I need
to find the location of the file in the registry.
I created a Registry Search and got the path I wanted.
I used this path to fill in the Folder property on a File Search.
This did not work for me because it appears that searching the target
machine searches the file system first, then the registry. Is this
assumption correct? Is there a workaround?


2.Using registry search property in launch condition in a file search

I'm trying to take a path extracted from a registry key and use that
path to search for a specific file. I have a registry search that finds
the key and successfully extracts the path. I gave it a property name
PATHVALUE. In my file search, I'm trying to set the folder value to
[PATHVALUE]. However, this does not seem to work. My search depth is
correct and I currently have no values for any of the Min/Max

Is what I want to possible? I'm trying to cover the case where the user
does not install the file in the Program Files folder.



3.Search Files using OS Search

Is it possible to call the OS Search (Start/Search) from a windows
form application?

What I'm looking is to develop an interactive cd using with
search capabilities. The cd will have some pdf, word , excel and html
documents, and what I need is to have the possiblity to search for
some text inside these files (the same that I can do with the windows

Thank in advance
Juan Miguel Lavista

4.How to search word in a richtextbox?


Is there a quick easy way to search a text for words in richtextbox?

I would like to make it work as a word document, as the having Find, Find 
Next by right click the richtextbox. THe words will be highlighted and the 
focus wil move to that part of ricktextbox after each search.

Any suggestions?
Thanks a lot


5.Searching a RichTextBox


I have a richtextbox and I want the users to be able to search for text within the control.  I would think that the richtextbox.find() would work, but I can't figure out how to get the textbox to scroll down and highlight the search text.  Any suggestions?

6. using ITTAPI interface / determing which interfaces a dll exposes

7. Interface features implemented without using Interface

8. using EM_GETRECT vs. using EM_GETLINECOUNT with a RichTextBox

Return to dotnet framework


Who is online

Users browsing this forum: No registered users and 23 guest