"Trying to revoke a drop target that has not been registered"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have a big problem to print an html file directly to the printer. I
use an "AxSHDocVw.AxWebBrowser" object. Briefly, this is my code:

AxSHDocVw.AxWebBrowser myBrowser;
....
//this set of instruction prepare my document in html to be printed

string HtmlFileName = "Test.html";
Object o = new Object();
o = System.Reflection.Missing.Value;
myBrowser.Silent = true;
myBrowser.Navigate(HtmlFileName);


// when it is ready the callback goes here
private void myBrowser_DocumentComplete(object sender, System.EventArgs e)
{
myBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref o, ref o);
}

When i call it (ExecWB) it generates an exception "Trying to revoke a drop
target that has not been registered".

Someone know how I can solve this problem, or if there is a quicker o
simpler method to solve it?

Thank you,
Regards,
Andrea
 
Hi Andrea,

Unfortunately I don't know what that error is about but if you don't mind
prompting the user you can get a reference to the IHTMLWindow2 object and
call window.print();

- Dave Sexton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top