ie dev toolbar

I know, I’m a bit behind the times, but I finally installed it to check it out.  If you haven’t yet, and you’re the sort of person who thinks they may someday make a webpage, you should get it.  The features are nice. The spy++-esque features, such as highlighting objects in the DOM, etc, are…

1

more fun with GetCommandLine()

Raymond mentioned this particular API once.  I mention it, because I had to call it today.  A certain third party app has existed for many years, happily calling CreateProcess() and not putting a space in the lpCommandLine string between the executable name and the first argument.  (I assume this was a bug, not intentional.) This worked for…

2

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 {public:    MyObject() { _pUnk = NULL; }    HRESULT DoStuff(IStream *pStream)   {      …       hr = CoUnmarshalInterface(pStream, IID_IUnknown,…

0

pop-up blocker and ActiveX controls, part three: creating a user initiated action

Note: This is part three in a series of posts explaining how ActiveX controls and the IE Pop-up Blocker should interact.  The first post is here.  If you are a user (and not an ActiveX control developer), and have found this post in an attempt to track down why you are still seeing unwanted pop-up…

8

pop-up blocker and ActiveX controls, part two: HlinkSimpleNavigateToMoniker()

Note: This is part two in a series of posts explaining how ActiveX controls and the IE Pop-up Blocker should interact.  The first post is here.  If you are a user (and not an ActiveX control developer), and have found this post in an attempt to track down why you are still seeing unwanted pop-up…

7

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. There are two things to keep in mind while considering…

8

why menus from tray notification icons don’t go away

I was looking at the documentation for TrackPopupMenuEx() today and saw this in the remarks section.  This, I suspect, explains a lot of frustration I have experienced in the past. To display a context menu for a notification icon, the current window must be the foreground window before the application calls TrackPopupMenu or TrackPopupMenuEx. Otherwise,…

2

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 *pCommandTarget = NULL;    hr…

6

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 (Command Identifier).  First, what is wrong with this code: HRESULT CFoo::Exec(const GUID…

7

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);   …} Answer: It will break on 64 bit machines. This is just one example of a well-known issue.  ComboBoxEx makes frequent use of -1 when asking for the item…

0