Browse by Tags

Tagged Content List
  • Blog Post: on CoUnmarshalInterface

    CoUnmarshalInterface() and CoGetInterfaceAndReleaseStream() are not re-entrancy safe. This has certain implications for objects that attempt to unmarshal interfaces into member variables, as a member of my team recently discovered. Suppose you have something that looks like this: class MyObject...
  • Blog Post: pop-up blocker and ActiveX controls, part one: IWebBrowser::Navigate(), IWebBrowser::Navigate2()

    As I mentioned previously , one reason users may continue to experience unwanted pop-up windows while browsing is creative use of ActiveX controls that provide methods that allow web sites to open new browser windows. This series of posts will provide best-practices for ActiveX control implementors....
  • Blog Post: IOleCommandTarget, CGID_MSHTML and ActiveX controls

    If you write an application that hosts the WebBrowser Control , and you want the control to do something, you can send commands to mshtml via the IOleCommandTarget interface. However, if you are an ActiveX control and you want to send CGID_MSHTML commands, you may try something like this: ... IOleCommandTarget...
  • Blog Post: on getting IOleCommandTarget wrong (and a bit in the middle about ActiveX controls)

    IOleCommandTarget is very useful. It provides a generic way of sending commands between objects. IE makes extensive use of IOleCommandTarget , both publically and internally. And, like IUnknown , people frequently get it wrong. Each command is composed of a GUID (Command Group Identifier) and a DWORD...
  • Blog Post: on 64 bit data conversion, comctl32 and reading the documentation

    Question: What is wrong with this code? case WM_DRAWITEM: { LPDRAWITEMSTRUCT pdis = (LPDRAWITEMSTRUCT) lParam; COMBOBOXEXITEM cbexItem = {0}; cbexItem.mask = CBEIF_IMAGE | CBEIF_SELECTEDIMAGE; cbexItem.iItem = pdis->itemID; CallWindowProc(pfnOldWndProc, hwnd, CBEM_GETITEM, 0, (LPARAM)&cbexItem...
  • Blog Post: on IObjectWithSite, IOleObject and ActiveX controls

    ActiveX® controls frequently need to communicate with their containing object. For example, a control may want to QueryService for the cached InternetSecurityManager object to decide whether or not to take a particular action . Controls can obtain a pointer to their containing object (also called the...
  • Blog Post: the importance of context

    Almost every navigation in Internet Explorer results in a flurry of security checks. Many of these checks are fairly obvious things, such as checking the URL of the current location (the context URL ) and the pending navigation's destination URL to see if their zones/domains/protocols/etc are the same...
  • Blog Post: on calling refresh during onResize

    From time to time I have come across web sites that do something like this: <body onResize=“document.execCommand('Refresh')”> ... </body> Generally this is done so the page can redo all of the necessary layout calculations for the new size it is being constrained to. This...
  • Blog Post: a brief history of setHomePage()

    I started working on IE right after IE 5.5 shipped. Since then, there is one little feature which has been the subject of my loving attention from time to time-- setHomePage() . setHomePage() is implemented as a behavior in iepeers.dll. It takes one argument-- the URL you would like to prompt the...
  • Blog Post: channel 9

    If you have not had a chance to check out channel 9 , click on over.
  • Blog Post: avoiding script injection and other lessons

    MSDN has had an article entitled Security Considerations: Dynamic HTML for a while. It is a good article, but it simply says what not to do. Everytime I run across it I promise myself I am going to write something more useful someday, something that says “Don't do this; do this instead.”...
  • Blog Post: enums and DeleteMenu()

    I wanted to add a menu item that had a child menu to one of the menus in the IE menu bar. I always kind of dread adding menu items to IE, because there is a lot of stuff going on there. IE and Explorer share the same frame, and the menu items are different depending on whether the frame is hosting the...
Page 1 of 1 (12 items)