473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

IViewObject

Hi,

How I get the interface IViewObject of a RichTextBox Control?
I would like to call the Draw Method with C#.

Thanks
Eric
Nov 17 '05 #1
5 4308
> How I get the interface IViewObject of a RichTextBox Control?
I would like to call the Draw Method with C#.

IViewObject is a COM interface. You'd have to dive into Interop to
retrieve that. That road would probably starti with adding a reference to
the COM library called "Microsoft Rich Text Control".

Why not call the Refresh() method on the .NET RichTextBox?

Greetings,
Wessel
Nov 17 '05 #2
Hi,

I'd rather conjure up a false PAINTSTRUCT and posted the WM_PAINT message to
the control (unless you have a managed way to ask the control to paint
itself). Messing with OLE interfaces would require good knowledge of the
underlying ActiveX control hosting stuff.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Eric" <ju*@nospam.nospam> wrote in message
news:eR**************@TK2MSFTNGP15.phx.gbl...
Hi,

How I get the interface IViewObject of a RichTextBox Control?
I would like to call the Draw Method with C#.

Thanks
Eric


Nov 17 '05 #3
> I'd rather conjure up a false PAINTSTRUCT and posted the WM_PAINT
message to the control (unless you have a managed way to ask the control
to paint itself). Messing with OLE interfaces would require good
knowledge of the underlying ActiveX control hosting stuff.

Why not call Refresh() on the .NET control?

That will cause a WM_PAINT to be send.

Greetings,
Wessel
Nov 17 '05 #4
Thanks,
But reason to use the interface, is because I want to copy the RTF content
to a picture/bitmap.
For that I need to call the Draw Method of IViewObject.

Eric
"Wessel Troost" <no*****@like.the.sun> schrieb im Newsbeitrag
news:op.suew65e1f3yrl7@asbel...
How I get the interface IViewObject of a RichTextBox Control?
I would like to call the Draw Method with C#.

IViewObject is a COM interface. You'd have to dive into Interop to
retrieve that. That road would probably starti with adding a reference to
the COM library called "Microsoft Rich Text Control".

Why not call the Refresh() method on the .NET RichTextBox?

Greetings,
Wessel

Nov 17 '05 #5
> But reason to use the interface, is because I want to copy the RTF
content to a picture/bitmap.


This link shows how to capture the surface of a control and save it in a
bitmap:
http://www.bobpowell.net/capture.htm

You were probably looking to pass a bitmap DC to WM_PAINT. I don't know
if that's possible in .NET.

Greetings,
Wessel
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben Taylor | last post by:
Further to my previous post on Transparency, is it possible for an ActiveX control to get the DC of its container, so it can just draw to that?
0
by: Johan Reitsma | last post by:
Hello, I'm trying to get a flash animation on a bitmap to use on a texture for Direct3D. The problem is I can't get OleDraw to work. Does anyone have an example in C# or in C++. Please help me....
0
by: ddd | last post by:
Can iviewobject be used in VB.net? If so how? I am basically trying to build a little application which would convert an html page into an image (bmp). I saw examples of it for C++ all over the...
5
by: Steven Hill | last post by:
Hello All! Has C# any classes to convert html page to gif or tif? Anyone could please, give how to do it? Br Wew
7
by: seema | last post by:
hi all , I am new to C++ programming. Can some body explain reason for this compilation error, .../inc/polecache.h", line 339: error #2322: object of abstract class type...
0
by: Jasleen | last post by:
I am using Flash ocx to play the .swf file in a windowless container. Now I use IViewObject::Draw to render the contents on the HDC provided by me. I create a compatible DC passing NULL parameter....
3
by: lalekse | last post by:
Hi there. I've been searching for 2 days now a way to load a resource (byte) into a Flash Player 9 ActiveX Container. I've found a lot of discussions, talking about IBindHost, IManiker and so...
0
by: LugPaj | last post by:
Hallo, i am trying to get updates, when the view of a .net webbrowser control is updated. So i implemented the IViewObject of this one and tried to use setadvise, so that a function is called,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.