enabling drag and drop

David Byron <[email protected]>
Newsgroups gmane.comp.mozilla.devel.embedding
Message-ID <[email protected]>
I've run into a snag enabling drag-and-drop.  The code that's failing is:

     nsCOMPtr<nsICommandManager> commandManager = 
do_GetInterface(m_web_browser);

where m_web_browser is declared like this

     nsCOMPtr<nsIWebBrowser>             m_web_browser;

and initialized as WebBrowserChrome::CreateBrowser in 
src/embedding/tests/winEmbed/WebBrowserChrome.cpp does.

The above do_GetInterface functions returns NULL.  I have logging turned 
on in gecko (all:5) and I see this in the log:

0[1584ab8]: WARNING: NS_ENSURE_TRUE(browserChrome) failed: file 
c:/utils/cygwin/home/dbyron/src/tuneup/trunk/mozilla/src/docshell/base/nsDocShell.cpp, 
line 10284
0[1584ab8]: nsComponentManager: 
CreateInstanceByContractID(@mozilla.org/embedcomp/command-manager;1) 
succeeded
0[1584ab8]: WARNING: NS_ENSURE_TRUE(browserChrome) failed: file 
c:/utils/cygwin/home/dbyron/src/tuneup/trunk/mozilla/src/docshell/base/nsDocShell.cpp, 
line 10284
0[1584ab8]: WARNING: NS_ENSURE_TRUE(aWindow) failed: file 
c:/utils/cygwin/home/dbyron/src/tuneup/trunk/mozilla/src/embedding/components/commandhandler/src/nsCommandManager.cpp, 
line 116
0[1584ab8]: WARNING: NS_ENSURE_SUCCESS(EnsureCommandHandler(), 
((nsresult) 0x80004005L)) failed with result 0x80004005: file 
c:/utils/cygwin/home/dbyron/src/tuneup/trunk/mozilla/src/docshell/base/nsDocShell.cpp, 
line 848

though I see the warning about browserChrome from line 10284 elsewhere 
in the log whether I try to get to nsICommandManager or not.

I would have thought the call to m_web_browser->SetContainerWindow would 
have gotten my nsIWebBrowserChrome implementation everywhere it needed 
to be, but I guess not.

Can anyone point me in the right direction for getting the warnings to 
go way, and more importantly, to getting an nsICommandManager so I can 
control drag-and-drop behavior?

Thanks much.

-DB
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.