|
-
Aug 13th, 2022, 08:39 AM
#1
Thread Starter
Fanatic Member
Can anybody write me a COM wrapper for RichTextBox (Winforms) to be used as an ocx?
Hello!
I need to use the WinForms RichTextBox in VB6.
Therefore I need to wrap it as COM control.
Would anybody be willing to write me a first sample with 2 properties and 2 methods as a starting point?
This way I could see how it's done and do the rest myself.
This would be so helpful!
Thak you very much for a reply!
-
Aug 17th, 2022, 12:37 PM
#2
Re: Can anybody write me a COM wrapper for RichTextBox (Winforms) to be used as an oc
Why would you need to use the RTB from .NET when VB6 has one of it's own?
You're just adding more complexity and layers that will probably get you into more trouble than it's worth.
-tg
-
Mar 3rd, 2023, 03:39 AM
#3
Thread Starter
Fanatic Member
Re: Can anybody write me a COM wrapper for RichTextBox (Winforms) to be used as an oc
-
Mar 3rd, 2023, 04:40 AM
#4
Re: Can anybody write me a COM wrapper for RichTextBox (Winforms) to be used as an oc
The VB6 guys here have an impressive body of work that includes many different types of Unicode controls.
While I can certainly help with this, I think there are good reasons not to pursue this approach. For one thing, if you wrap a .Net Control for use in a VB6 application, you will not be able to site it on a VB6 ThunderForm. WinForms and VB6's UI engine are fundamentally incompatible. The only way to use it properly would be to export an entire .Net Form with the Control which would work well in VB6. I actually showed how to do just that in this CodeBank post.
The other reason I recommend against this is because using COM interop adds the extra responsibility of making sure you have the correct framework installed. VB6 would already require you to register COM components for use and now .Net will just add this extra requirement. I like COM interop only as a last resort and there are many things in .Net that are not easily available in VB6 that would warrant using COM interop, I just don't think this is such a situation.
-
Mar 3rd, 2023, 08:12 AM
#5
Re: Can anybody write me a COM wrapper for RichTextBox (Winforms) to be used as an oc
 Originally Posted by Niya
The VB6 guys here have an impressive body of work that includes many different types of Unicode controls.
Yeah, just use Kr00l's Unicode compatible RTB.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|