473,320 Members | 1,848 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,320 software developers and data experts.

HtmlEditor update

I've posted an update to the HtmlEditor - hosts Msthml in C#. I've removed
the dependency on Microsoft.mshtml. See here:

http://www.itwriting.com/htmleditor

It would be nice to be able to use the DOM in System.Windows.Forms with the
control. You can easily get the unmanaged DomDocument from a managed
HtmlDocument. Does anyone know a way to do the opposite?

Tim
Tech blog: http://www.itwriting.com/blog
May 19 '06 #1
9 1535
HI Tim,

Usually an announcement post is preceded with an ANN prefix in the subjetc.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tim Anderson" <ti*****@nospam.nospam> wrote in message
news:Og**************@TK2MSFTNGP03.phx.gbl...
I've posted an update to the HtmlEditor - hosts Msthml in C#. I've removed
the dependency on Microsoft.mshtml. See here:

http://www.itwriting.com/htmleditor

It would be nice to be able to use the DOM in System.Windows.Forms with
the control. You can easily get the unmanaged DomDocument from a managed
HtmlDocument. Does anyone know a way to do the opposite?

Tim
Tech blog: http://www.itwriting.com/blog

May 19 '06 #2
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:Om**************@TK2MSFTNGP03.phx.gbl...
Usually an announcement post is preceded with an ANN prefix in the
subjetc.


Well, it was a question as well as an ANN. Any ideas?

Tim
Tech blog:
http://www.itwriting.com/blog
May 19 '06 #3
Hi,

Opps, sorry I did not read the last sentence

And no, I don;t know how to do so. and frankly don't think that the
unmanaged DOM keeps a reference to the containing HtmlDocument
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
May 19 '06 #4
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:eN**************@TK2MSFTNGP04.phx.gbl...
And no, I don;t know how to do so. and frankly don't think that the
unmanaged DOM keeps a reference to the containing HtmlDocument


The unmanaged DOM has no knowledge of any .NET classes. However I'd have
thought there could be a constructor somewhere that creates a managed
HtmlDocument from a reference to an unmanaged HTMLDocument, without actually
displaying it in the WebBrowser control.

Tim
Tech blog: http://www.itwriting.com/blog
May 19 '06 #5
Hi Tim,

I think you may try the method below.
NOTE: you need to have the interface and the interface must be valid. That
is to say, the interface should be pointed to an Object which have been
created.
Marshal.GetObjectForIUnknown Method
http://msdn2.microsoft.com/en-US/lib...pservices.mars
hal.getobjectforiunknown.aspx

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

May 22 '06 #6
""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:mR**************@TK2MSFTNGXA01.phx.gbl...
I think you may try the method below.
NOTE: you need to have the interface and the interface must be valid. That
is to say, the interface should be pointed to an Object which have been
created.
Marshal.GetObjectForIUnknown Method


Peter,

Thanks for the suggestion. You may have misunderstood the requirement. This
method (and the similar Marshal.GetTypedObjectForIUnknown) can only return a
wrapper generated by the type library importer. This is not the case with
System.Windows.Forms.HtmlDocument.

Tim
Tech blog: http://www.itwriting.com/blog
May 22 '06 #7
Hi Tim,

I understand your scenario, if you look at the HTMLDocument class, it did
not include a ctor or a method to create a HTMLDocument based on a
IHTMLDocument interface. Actually this is somewhat a kind of .NET wrap.

If we look into the HTMLDocument class in MSDN, we will get the definition
as below.
Note: This class is new in the .NET Framework version 2.0.
Provides top-level programmatic access to an HTML document hosted by the
WebBrowser control.

As you said, the unmanaged HTMLDocument interface did not include a
reference to a managed HTMLDocument class.
So according to the document, the HTMLDocument class is used to help to
access to an HTML document hosted by the WebBrowser control. That is why it
did not have a ctor to create a HTMLDocument.

Also from your description below
"It would be nice to be able to use the DOM in System.Windows.Forms with
the
control. You can easily get the unmanaged DomDocument from a managed
HtmlDocument. Does anyone know a way to do the opposite?"

So I understand that you already have a unmanaged DomDocument, and you want
to get its managed reference. As you said in the previous post,
Marshal.GetTypedObjectForIUnknown will get a wrapper generated by MSHTML
COM TypeLib which is provided by MS. I just wonder why you did not want use
the wrapper. If you do not want to use MSHTML library in .NET, I think you
have to build one HTML .NET wrapper yourself. This should be complex job,
if you do wanna do that, I suggest you contact MSPSS directly.

http://support.microsoft.com

If I have any misunderstanding or you have any concern, please feel free to
post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

May 23 '06 #8
""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:x3**************@TK2MSFTNGXA01.phx.gbl...
Hi Tim,

I understand your scenario, if you look at the HTMLDocument class, it did
not include a ctor or a method to create a HTMLDocument based on a
IHTMLDocument interface. Actually this is somewhat a kind of .NET wrap.
Yes - there is a constructor of course but it is marked internal so not
accessible.
So I understand that you already have a unmanaged DomDocument, and you
want
to get its managed reference. As you said in the previous post,
Marshal.GetTypedObjectForIUnknown will get a wrapper generated by MSHTML
COM TypeLib which is provided by MS. I just wonder why you did not want
use
the wrapper.
Just to be clear, there are two wrappers under discussion here. There is the
..NET 2.0 wrapper which is part of the Framework (HtmlDocument etc), and
Microsoft.Mshtml which is the PIA for MSHTML. It's the former that I want to
use, not the latter. The main problem with the latter, by the way, is its
large size and the fact that it is not distributed with dotnetfx.exe but has
to be deployed separately; there are also some bugs in its implementation.

If you look at the documentation for the .NET 2.0 wrapper (as opposed to the
PIA), you'll note that it is only a subset of what is in MSHTML. Further,
the WebBrowser control does not offer an edit mode; you can set designmode
on via DomDocument, but there seem to be some bugs and problems with this
(I've not fully investigated). In addition, there are scenarios where you
might want to process HTML without displaying anything in the WebBrowser
control.
If you do not want to use MSHTML library in .NET, I think you
have to build one HTML .NET wrapper yourself. This should be complex job,


Yes, this is what I've done; but I find it frustrating that you can't use
the nice MSHTML wrapper built into .NET Framework 2.0 for documents that are
not loaded into the WebBrowser control.

My wrapper is here:

http://www.itwriting.com/htmleditor/index.php

Tim
May 23 '06 #9
Hi Tim,

I do understand your concern in this scenario, I highly suggest you can
submit this feedback to our product feedback center:

http://lab.msdn.microsoft.com/produc...k/default.aspx

Our feedback team will consider your suggestion and keep improving our
product.

Thanks for your understanding!
Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

May 24 '06 #10

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

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
27
by: VK | last post by:
<http://www.jibbering.com/faq/#FAQ3_2> The parts where update, replacement or add-on is needed are in <update> tag. 3.2 What online resources are available? Javascript FAQ sites, please...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
0
by: Tim Anderson | last post by:
I've set up a documentation wiki for the HtmlEditor, a C# control which wraps Mshtml: http://www.itwriting.com/htmleditor/docwiki It's still very early days; but I expect a lot of the material...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
8
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. ...
5
by: Stephen Plotnick | last post by:
I'm very new to VB.NET 2003 Here is what I have accomplished: MainSelectForm - Selects an item In a public class I pass a DataViewRow to ItemInformation1 Form ItemInformation2 Form
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.