Answered by:
Problem linking stylesheet to embedded MSHTML in Windows 8 CP

Question
-
I have an application which uses an embedded MSHTML browser control.
I use the IHTMLDocument2.CreateStyleSheet function to link a CSS file to the document.
This works in Window XP to Windows 7, but in Windows 8 I get an out of memory exception from CreateStyleSheet.
As a workaround, I used CreateElement to create a link element and append it to the Head element.
This code runs but the stylesheet is not applied. The workaround code correctly applies the stylesheet in Windows 7.
Any suggestions?
TIm
- Edited by Tim Anderson Sunday, April 1, 2012 10:38 AM
- Moved by Mike Dos Zhang Monday, April 2, 2012 9:14 AM A IE API usage problem (From:General Windows Desktop Development Issues)
Sunday, April 1, 2012 10:37 AM
Answers
-
Good suggestion, but it turns out the closest forum here is actually:
http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/threads/
having said which the best advice for IE 10 problems is to report it on Connect apparently.
Tim
- Proposed as answer by Ed Price - MSFTMicrosoft employee Saturday, April 7, 2012 11:46 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Monday, April 16, 2012 8:15 AM
Wednesday, April 4, 2012 8:30 AM
All replies
-
Mike, why not move this to the correct forum instead of moving it to "What is the forum for?"
Tim
Monday, April 2, 2012 9:20 AM -
Try asking this question in the Internet Explorer Web Development Forum at the following address
http://social.msdn.microsoft.com/Forums/en-us/iewebdevelopment/threads
Bye.
Luigi Bruno - Microsoft Community Contributor 2011 Award
- Proposed as answer by Ed Price - MSFTMicrosoft employee Wednesday, April 4, 2012 8:21 AM
- Unproposed as answer by Tim Anderson Wednesday, April 4, 2012 8:28 AM
Monday, April 2, 2012 9:20 AM -
This is not a Windows Desktop Development issue, it is a IE API question.
I cannot find out a suitable forum for you, please try to let this forum expert help you to find one suitable forum.
If there's any concern, please feel free to let me know.
Best wishes,
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
Monday, April 2, 2012 9:21 AM -
Mike, I researched this and my conclusion was Windows Desktop Development was the closest fit. It looks to me like a bug in Windows 8 CP and I would like it reported; or if it is not a bug, advice on how to workaround.
Tim
Monday, April 2, 2012 9:24 AM -
Thanks, I'll try.
Tim
Monday, April 2, 2012 9:27 AM -
You have typed in wrong area this is not the issue related to Windows Desktop Development, this is related to Internet Explorer API please write in correct forum Mike
- Proposed as answer by Shayan Anique Monday, April 2, 2012 11:33 AM
- Unproposed as answer by Tim Anderson Monday, April 2, 2012 1:54 PM
Monday, April 2, 2012 11:31 AM -
Hi Shayan
It is an issue related to Windows Desktop Development because this is a Windows desktop app which embeds MSHTML. However I am grateful to you and your colleague for helping me find the right forum; if you could also find someone to help me with the question that would be great too :-)
Tim
Monday, April 2, 2012 2:00 PM -
Excuse me, Shayan?
I think I cannot got your meaning.
Internet Explorer platform API is in the Web Development part,
It is not a Windows Desktop Api, it is a IE platform Api, and I find no a forum for discussing the IE platform Api usage problem, so we use this forum to ask for help if any experts here can give a suggestion to find a forum for this question.
If there's any concern, please feel free to let me know.
Best wishes,
Mike Zhang[MSFT]
MSDN Community Support | Feedback to us
- Edited by Mike Dos Zhang Tuesday, April 3, 2012 9:13 AM
Tuesday, April 3, 2012 8:48 AM -
Good suggestion, but it turns out the closest forum here is actually:
http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/threads/
having said which the best advice for IE 10 problems is to report it on Connect apparently.
Tim
- Proposed as answer by Ed Price - MSFTMicrosoft employee Saturday, April 7, 2012 11:46 PM
- Marked as answer by Ed Price - MSFTMicrosoft employee Monday, April 16, 2012 8:15 AM
Wednesday, April 4, 2012 8:30 AM