LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TSOP Print Error

Hi,
    I have customised CVI Operator Interface available with TestStand3.5. My requirement was put a PRINT button and on pressing that button,  print an html report from user defined location. To print HTML file,  I used APIs available with ie.fp available in ActiveX examples available with CVI. I used "Navigate" and "ExecWb" functions with print parametrs of IWebBrowser2. I was able to execute all the functions except ExecWb where I am getting error. The activex error I am receiving are, "unknown error" or "stub received bad data". If I am executing a standalone print program without integrating with operator interface code, I am able to print properly. I am using CVI8.1. Any help would highly appreciated.....Thanks in advance
Best Regards,
                 Vijay
0 Kudos
Message 1 of 3
(3,168 Views)
Hi Vijay,

Hope you had a nice holiday! There are a few things we could try with the CVI Operator Interface.  The first option we have is using the Query Status WB function.  This will return the status when opening the web browser.  If the status returns a 0, then web browser has not successfully loaded the page yet.  Once the page is opened and loaded properly, it will return a non-zero number.  You could check this status before you try to print the page.

Another option would involve using the CA_VariantSetShort function.  This will allow us to notify the Exec WB function when the page is ready to print.  Place the variant from the CA_VariantSetShort into the "PVA in" parameter of the Exec WB function.  Here is an example:

CA_VariantSetShort (&printOption, 3);
IE_IWebBrowser2ExecWB (ieHandle, NULL, IEConst_OLECMDID_PRINT, IEConst_OLECMDEXECOPT_PROMPTUSER, printOption, NULL);

Also, when you receive these errors, is there an error number?  I hope this helps.  Thanks!
Matt S
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(3,139 Views)

Hi,

          It worked well.....Smiley Happy. I made a small addition that instead of passing NULL as error info, I passed pointer to error info as it showed an error of "Null pointer to stub"......Anyway it worked out. Thank you so much for your help.......Smiley Happy

0 Kudos
Message 3 of 3
(3,100 Views)