Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

DimaC

@DimaC
About
Posts
13
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to parse CSS of a HTML document using MSHTML ?
    D DimaC

    Thanks !

    Web Development html css help tutorial question

  • How to parse CSS of a HTML document using MSHTML ?
    D DimaC

    Is it possible to parse the CSS of an HTML document using MSHTML ? I need to get the css style assigned to any element from the html. When the style is written inside the element's tag, then its structure is contained in "style" attribute of that element (e.g.: node.getAttribute("style") contains the structure of the css style of the 'node' element). However if the element refers to an outside CSS class (e.g. - refers to class main) then the mshtml control doesn't seem to offer the possibility to parse the "main" style like in the above case. Can anybody help me ? Thanks.

    Web Development html css help tutorial question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    I've tried to access the nodes by indexes (not through enumeration) - doesn't help much. Ran the profiler on mshtml.dll too, and it showed that most time is spent on accessing the attributes and children of nodes. Thus there's only one possible reason - either .NET works slowly when accessing mshtml elements, either the mshtml is generated wrong (which I doubt).

    C# csharp html json question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    I am sure that if there's something wrong, then it's wrong with the mshtml.dll . As I said before, if I run a VB6 COM that uses the HTMLDocument from C# (received as a parameter to its function) - then it runs slowly, but if the VB6 COM doesn't take the C# HTMLDocument (load the page itself) - then it runs fast. How to run the profiler on mshtml.dll ? As you said at the beginning - you didn't encounter such things as slow running. Have you made a similar module or code that parses a HTMLDocument object using mshtml ? If so - what VS.NET did you use , and on what windows ? Thanks.

    C# csharp html json question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    I have run the profiler. The biggest part of the time is spent on accessing/enumerating (with Foreach, or with IEnumerator) all children or all attributes of each node.

    C# csharp html json question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    1. The program doesn't modify the DOM for sure. 2. Probably there's a bug in the interop. 3. I am caching the reference to DOM objects (i.e. access the objects always through a local object). I have made a simple COM in VB6 that takes as input a HTMLDocument object and runs the same algorithm as the one written in C#. If it's run by a VB6 program - it runs very fast. If it's run by C# - then it runs slowly, similar to C# code. But ! if the VB6 com receives the URL of the page, loads it itself and then calls the function that parses it - then it works very fast again. I think this is due to some kind of .NET object wrapper.

    C# csharp html json question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    This is the C# code that I used for tests (doc is a HTMLDocument variable): ArrayList nodes=new ArrayList(); mshtml.IHTMLDOMNode nod; children=(mshtml.IHTMLDOMChildrenCollection)doc.childNodes; foreach(mshtml.IHTMLDOMNode node in children) nodes.Add(node); mshtml.IHTMLAttributeCollection attributes; for(int a=0;a

    C# csharp html json question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    What do you mean by a profiler ? I have made a test end code - a code that simply gets recursively all children of each node and that runs through each attribute of each node. Even very simple html pages run in 1-2 seconds. However the same pages, with the same algorithms, run instantly on VB6 or VC++ 6. Can you provide me a simple C# project that does the same thing and runs instantly on html pages of medium complexity ?

    C# csharp html json question

  • Using mshtml to parse a html document in C# works very slow - Why ?
    D DimaC

    Parsing a html document in C# using mshtml object works very slow. Why is this happening ? Is it possible to avoid it ?

    C# csharp html json question

  • How to suspend drawing operation of a form ?
    D DimaC

    Actually I use standart controls in a usercontrol. And this usercontrol is placed on a form. Anyway - I read somewhere that SuspendLayout works only a few of the controls, because many of them has their own way of painting. With standart controls, probably like buttons, labels - it may work. With textboxes it doesn't work for sure (as it's controled by Windows).

    C# tutorial graphics question

  • How to suspend drawing operation of a form ?
    D DimaC

    SuspendLayout is a bullshit. It doesn't work as it should. It do blocks some of the controls repainting, but allows others. I have tried it many times - and it never worked as expected.

    C# tutorial graphics question

  • How to suspend drawing operation of a form ?
    D DimaC

    Yes, I have done it like this. Maybe there is a certain function in .NET that makes the same , but in an easier way. Something like: BeginUpdate(); .... some code here ... EndUpdate(); Between these 2 tags the controls are not repainted. Now I have made it through message filtering, i.e. I have a variable , which when set TRUE, paint messages are not allowed to be dispatched to controls contained in the form. Works well.

    C# tutorial graphics question

  • How to suspend drawing operation of a form ?
    D DimaC

    How to suspend drawing operation of a form while a block of operations is done ? For example I need to draw some things on the form and to move some controls so that the form doesn't repaint after each of them was moved.

    C# tutorial graphics question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups