Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo

  Any VB/COM experts here?? (Tuesday, December 21, 2004)




Found the following interesting discussion in the Newsgroups:

Any VB/COM experts here??
by: SamSpade

Applications can retrieve an ITextDocument pointer from a rich edit control.
To do this, send an EM_GETOLEINTERFACE message to retrieve an IRichEditOle
object. Then, call the object's QueryInterface method to retrieve an
ITextDocument pointer.

How to do that?? I tried:

Dim oREO As Object

Dim mIDocument As tom.ITextDocument

SendMessage(Handle, EM_GETOLEINTERFACE, 0, oREO)

mIDocument = CType(oREO, tom.ITextDocument)

But this produces a "Cast Not Valid" message

Anyone have any insight as to how to make VB call QueryInterface??

Thanks in advance


 Reply:
by:hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP])

 
Untested in your situation:
'System.Runtime.InteropServices.Marshal.QueryInterface'.

--
Herfried K. Wagner [MVP]


 Reply:
by: SamSpade

 I had read this but did not understand how to use it.

Thanks


 Reply:
by: SamSpade

 Maybe I've got it








0 Comments:

Post a Comment

 
Previous Posts
    - The specified domain either does not exist or coul...
    - Measuring an angle
    - Unable to upgrade VB6 COM Dll to VB.Net
    - TypeConverter.CreateInstance-Method
    - vb.net & word
    - How to let GUI application write output to command...
    - Copy object with .Net?
    - Find the cursor position in a textbox
    - Extracting Image Metadata
    - NTFS Folder Permissions

Archives
    - 10/03/2004 - 10/10/2004
    - 10/10/2004 - 10/17/2004
    - 10/17/2004 - 10/24/2004
    - 10/24/2004 - 10/31/2004
    - 10/31/2004 - 11/07/2004
    - 11/21/2004 - 11/28/2004
    - 11/28/2004 - 12/05/2004
    - 12/05/2004 - 12/12/2004
    - 12/12/2004 - 12/19/2004
    - 12/19/2004 - 12/26/2004
    - 12/26/2004 - 01/02/2005
    - 01/23/2005 - 01/30/2005
    - 01/01/2006 - 01/08/2006
    - 09/24/2006 - 10/01/2006

Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland