locked
Need PIAs for MSHTML 8 RRS feed

  • Question

  • I've got an application that references Microsoft.mshtml.dll version 7.x.  I'd like to use mshtml version 8 since it supports css 2.1 (specifically the content property for before/after pseudoelements).

    Unfortunately, I cannot find PIAs for mshtml 8.x. I attempted to reference mshtml.dll directly, but go the following error:

    A reference to 'mshtml.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

     

    Does anyone know how I can find/generate these PIAs?

     

    Thanks,
    Steve

    Friday, September 3, 2010 3:32 PM

Answers

  • Hi,

    I just checked the mshtml.tlb under windows/system32, it is v7.0. And the mshtml.dll under windows/system32 is v8.0. But it failed with tmpimp.exe because it doesn't contain a type library. Currently I haven't found the tlb file for mshtml.dll v8.0. I am looking into this. Sorry for the late response. I would suggest considering https://connect.microsoft.com as an option. Please share the connect issue link to help others tracking it.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Edited by SamAgain Thursday, September 16, 2010 9:05 AM refine
    • Marked as answer by SamAgain Tuesday, October 12, 2010 7:01 AM
    Thursday, September 16, 2010 9:03 AM

All replies

  • Hi,

    Thanks for your post.

    Please take a look the following references. They address what PIA is, how to produce it and some FAQs.

    1. Primary Interop Assemblies

    2. Primary Interop Assemblies (PIAs)


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Thursday, September 9, 2010 9:39 AM
    • Unmarked as answer by SteveFennell Thursday, September 9, 2010 2:28 PM
    Tuesday, September 7, 2010 9:00 AM
  • Hi Sam,

     

    Thanks for taking the time to respond to my post.  I looked at the two links you sent me and attempted to generate a PIA for mshtml.dll using tlbimp.exe.  Unfortunately, I received the following error:

    TlbImp : error TI0000 : The input file 'C:\Windows\System32\mshtml.dll' is not a valid type library.

    After investigating this error, it looks like this error signifies that the dll is not a COM dll.  Is this the case for Microsoft's mshtml.dll?

    Thanks,

    Steve

     

    PS- When using the version 7 dll, we used the Microsoft.Mshtml.dll files distributed with office.  Are there no distributed PIAs for version 8?

    Thursday, September 9, 2010 1:35 PM
  • Hi,

    Thanks for your feedback. There's a mshtml.tlb file in the Windows/system32 folder. The tlbimp.exe should work on that file. The type library is not bound together with the dll. I hope this could be helfpful.


    Please mark the right answer at right time.
    Thanks,
    Sam
    Friday, September 10, 2010 9:57 AM
  • Hi Sam,

    I'm not quite sure I understand.  Is the mshtml.tlb file in the Windows/system32 folder version 8?

    I did run tlbimp.exe on that file and referenced the dll it created in my project.  Unfortunately, it doesn't seem to have the properties that I would expect from mshtml version 8.0 (eg. css content property).

    Do I need to find a version 8 mshtml.tlb or something?


    Thanks again for all of your help,

    Steve

     

    Friday, September 10, 2010 2:42 PM
  • Hi,

    I just checked the mshtml.tlb under windows/system32, it is v7.0. And the mshtml.dll under windows/system32 is v8.0. But it failed with tmpimp.exe because it doesn't contain a type library. Currently I haven't found the tlb file for mshtml.dll v8.0. I am looking into this. Sorry for the late response. I would suggest considering https://connect.microsoft.com as an option. Please share the connect issue link to help others tracking it.


    Please mark the right answer at the right time.
    Thanks,
    Sam
    • Edited by SamAgain Thursday, September 16, 2010 9:05 AM refine
    • Marked as answer by SamAgain Tuesday, October 12, 2010 7:01 AM
    Thursday, September 16, 2010 9:03 AM
  • Did you ever find a way to reference MSHTML v8 in your project? I'm facing the exact same issue...

    Thanks...


    wiz developer
    Tuesday, January 25, 2011 6:50 PM
  • Build em yourself!

     

    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=bd98f760-1279-46f2-a456-de6df365584b&displaylang=en
               
    start menu -> Windows SDK 7.1 Command Prompt
               
    cd c:\temp
    midl "C:\Program Files (x86)\Microsoft SDKs\Internet Explorer\v8\include\mshtml.idl"
    tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml /asmversion:8.0

    tada!

    • Proposed as answer by Oskar Lindgren Tuesday, April 26, 2011 2:54 PM
    Tuesday, April 26, 2011 2:53 PM
  • Oskar! Thank you so much, that worked great for IE8. 

     

    However, when I download the Headers and Libraries for Windows Internet Explorer 9 (http://www.microsoft.com/download/en/confirmation.aspx?id=22934) and try the same thing, I get about a million "error MIDL2035: constant expression expected" errors and it does not work. Any clue?

    Thanks :)

     

     


    wiz developer
    Tuesday, July 12, 2011 3:52 AM
  • For those who followed thus far in the thread and are left hanging about all of the error messages ... there is an answer at http://stackoverflow.com/questions/6669475/how-to-compile-a-dll-for-mshtml-v9-im-currently-getting-100s-of-midl-2035-co.

    Basically, remember to set your INCLUDE environment variable to list the Internet Explorer\v9\include directory first.  This is after installing the Headers and Libraries download mentioned above.

    But also, the first midl step that Oskar mentions may not be necessary since the mshtml.tlb file should be in C:\Windows\System32 and/or C:\Windows\SysWOW64 after installing IE9.  Run tlbimp on that mshtml.tlb file as Oskar suggests above, except this will be version 9.0 (e.g., 9.0.8112.16434) for IE9.



    Sunday, August 28, 2011 4:39 AM
  • 1,000,000 thank yous!
    Wednesday, November 16, 2011 2:47 PM
  • I've generated the Microsoft.mshtml.dll assembly file from "tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml /asmversion:8.0" command but after loading the assembly into my application; the render engine is still IE7!

    I've tried using midl on mshtml.idl from both IE8 and IE9 headers and libaries, it does not seem to matter. Did anyone else run into this problem?

    Tuesday, May 1, 2012 10:41 PM
  • It turns out that I need an additional registry key for this to work for WebBrowser Control in my application.

    See: http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx

    Wednesday, May 2, 2012 3:53 PM