Helf for ATL -> C# translation

  • Thread starter Thread starter Sunny
  • Start date Start date
S

Sunny

Hi,
As ATL/C++ are not my strongest field :), I'd like to ask for a little
help here.

Problem: I'm using mshtml to parse web pages. In the thread "Want to use
msHTML.HTMLDocumentClass" as response to my question Hasani was so kind
to point me that link (possible line wraps):
http://support.microsoft.com/default.aspx?
scid=http://support.microsoft.com:80/support/kb/articles/Q266/3/43.asp&N
oWebContent=1

There is stated some problem with mshtml parser when loads pages with
scripts, but the solution is in C++.

I need somehow to implement this in C#, so my code will not have this
problem.

Thanks
Sunny
 
Hi,

This is probably a good question for the
microsoft.public.dotnet.framework.interop NG.
 
Sunny,

You can do this, but it is a pain. First, you have to define the
IOleObject interface and then query your instance of HTMLDocument for that
interfrace. Once you have that, you set the client site to be an object of
your choosing.

Once you have that, you will have to define a method with zero
parameters and has the DispId attribute attached to it. The value for this
attribute is DISPID_AMBIENT_DLCONTROL. This will allow your method to be
called through automation so you can return the value indicating that
scripts should not be run. The return value of your method should be an
int.

Hope this helps.
 
Hi Nicholas,

Sunny,

You can do this, but it is a pain. First, you have to define the
IOleObject interface and then query your instance of HTMLDocument for that
interfrace. Once you have that, you set the client site to be an object of
your choosing.

Once you have that, you will have to define a method with zero
parameters and has the DispId attribute attached to it. The value for this
attribute is DISPID_AMBIENT_DLCONTROL. This will allow your method to be
called through automation so you can return the value indicating that
scripts should not be run. The return value of your method should be an
int.

Hope this helps.

Thanks for the post. The second part is clear for me :) (i.e. I can
figure it out). But I can not understand what you mean by the first part
- how to define that interface?
By "query HTMLDocument" you mean what?

Thanks
Sunny
 
Hi Sunny,

MSDN documented the IOleObject interface. You must implement all the
methods of this interface follow the document below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm/oin
_ol2t_0jp0.asp

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Sunny <[email protected]>
| Subject: Re: Helf for ATL -> C# translation
| Date: Mon, 17 Nov 2003 16:05:42 -0600
| References: <[email protected]>
<[email protected]>
| Organization: Iceberg Wireless LLC
| MIME-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-15"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: MicroPlanet Gravity v2.60
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 216.17.90.91
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:199978
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi Nicholas,
|
| In article <[email protected]>,
| (e-mail address removed) says...
| > Sunny,
| >
| > You can do this, but it is a pain. First, you have to define the
| > IOleObject interface and then query your instance of HTMLDocument for
that
| > interfrace. Once you have that, you set the client site to be an
object of
| > your choosing.
| >
| > Once you have that, you will have to define a method with zero
| > parameters and has the DispId attribute attached to it. The value for
this
| > attribute is DISPID_AMBIENT_DLCONTROL. This will allow your method to
be
| > called through automation so you can return the value indicating that
| > scripts should not be run. The return value of your method should be an
| > int.
| >
| > Hope this helps.
|
| Thanks for the post. The second part is clear for me :) (i.e. I can
| figure it out). But I can not understand what you mean by the first part
| - how to define that interface?
| By "query HTMLDocument" you mean what?
|
| Thanks
| Sunny
|
 
Back
Top