473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Jul 17 '06 #1
1 5758
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

"Digitek" <Di*****@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
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

Jul 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lars Schlanbusch | last post by:
Hi! Is there any way to set <base target="_blank"> for links which link to a page outside the domain, and <base target="_self"> for links which link to a page inside the domain? Can i do such...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
6
by: Tony Marston | last post by:
The code <a href="..." target="_blank">...</a> will not validate as XHTML STRICT because of the 'target' tag, so how do I achieve the same result by moving it to a CSS file? I cannot find anything...
8
by: pocm | last post by:
Hi, What's the property/value I need to set in css for A to mimic the results of <a href="..." target="_new">...</a>? Cheers, Paulo Matos
1
by: jgctr4 | last post by:
I'm trying to print an HTML file using AxWebBrowser.ExecWB but it it gives a run time error "Trying to revoke a drop target that has not been registered". Does anyone have any suggestions? ...
4
by: Larry R Harrison Jr | last post by:
I have them working now, courtesy of the link given in the prior thread--the HVMenu over at Dynamic Drive myself. http://www.dynamicdrive.com I have them working as side-bar menus, not...
1
by: Phre2d | last post by:
We are attempting to move a large development project into the .NET age over time. We have a large number of ATL-based COM objects in this project. Following the "Journal Poster" example provided...
5
by: Kevin Buchan | last post by:
I came in today and tried to edit a project that I was working with, locally, at the tail end of last week. This web project was created, hosted, and only edited locally. I truly cannot...
8
by: msnews.microsoft.com | last post by:
I want to redirect the user to a url outside of our website but I want it to preserve our application's window by opening a new window. We have a datagrid that has five hyperlink columns containing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.