TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mary
NA
5
0
Webbrowser in web service problem
Dec 6 2011 7:11 AM
Hi,
I am using webbrowser control in C# . And calling that webbrowser in web service. when i want print from Html Page use of
following code:
const short PRINT_WAITFORCOMPLETION = 2;
const int OLECMDID_PRINT = 6;
const int OLECMDEXECOPT_DONTPROMPTUSER = 2;
var browser = new WebBrowser();
browser = Browser;
while (browser.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();
dynamic ie = browser.ActiveXInstance;
HtmlDocument htmld = (HtmlDocument)browser.Document;
htmld .Body.InnerHtml = HtmlDoc;
ie.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, PRINT_WAITFORCOMPLETION);
I get the following error
:
"TargetInvocation exception" and "Unable to get window handle for WebBrowser Control. Windowless ActiveX control not Supported"
Please Help how to resolve it.
Reply
Answers (
2
)
Tabcontrol Header Click Event
C#, Generic, VS2008: Generic, class type, Byte Array