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.
Loading
maryPosted Dec 8, 2011, 5:29 AM
My goal is writing the web service method that print from a html string.I did it using a web browser that came across the above error.
"TargetInvocation exception" and "Unable to get window handle for WebBrowser Control. Windowless ActiveX control not Supported"
Please Help how to resolve it.
Sam HobbsPosted Dec 6, 2011, 1:29 PM