Hello,

I’m trying to disable the d&d support from the win32_test, following the
instructions from the faq. To do so, in createwindow, after the call to
baseWindow->Create, I stuck the following code :

 rv = baseWindow->Create();
  if (NS_FAILED(rv)) {
    printf("Create\n");
  }
<here>
  /* Drag and drop */
  nsCOMPtr<nsICommandManager> CommandManager =
do_GetInterface(mPrivate->webBrowser);
        if (CommandManager)
        {
          nsCOMPtr<nsIDOMWindow> theDOMWindow =
do_GetInterface(mPrivate->webBrowser); 
          nsCOMPtr<nsICommandParams> cmdParamsObj =
do_CreateInstance(NS_COMMAND_PARAMS_CONTRACTID,&rv);
          nsISupports *tmp;
          tmp = (nsISupports *)mPrivate->chrome;
          cmdParamsObj->SetISupportsValue("addhook",   tmp ); //
reinterpret_cast<nsISupports*>(mPrivate->chrome) returns an error
          
          CommandManager->DoCommand("cmd_clipboardDragDropHook",
cmdParamsObj, theDOMWindow);
        }


I also modified the WebBrowserChrome so that it implements
nsIClipboardDragDropHooks and provided a default implementation for every
method of nsIClipboardDragDropHooks.

In particular changed NS_IMPL_ISUPPORTS5 ( ...  ) into 
NS_IMPL_ISUPPORTS6(WebBrowserChrome,
  nsIWebBrowserChrome,
  nsIInterfaceRequestor,
  nsIEmbeddingSiteWindow,
  nsIClipboardDragDropHooks,
  nsIWebProgressListener,
  nsISupportsWeakReference )

At execution, the interface is never requested, and its methods never
called.

Any hint appreciated .
TIA.

Philippe.

_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to