error on print from activex

error on print from activex

Postby Silvio.Falconi » Fri Dec 04, 2020 11:05 am

give me this error

Time from start: 0 hours 0 mins 17 secs
Error occurred at: 12/04/20, 11:57:27
Error description: (DOS Error -2147352567) WINOLE/1007 (0x80040100): EXECWB
Args:
[ 1] = N 6
[ 2] = N 1

Stack Calls
===========
Called from: => TOLEAUTO:EXECWB( 0 )
Called from: => __OBJSENDMSG( 0 )
Called from: .\source\classes\ACTIVEX.PRG => TACTIVEX:DO( 96 )
Called from: => (b)EVAL( 506 )




Code: Select all  Expand view
                 

#Define OLECMDID_PRINT 6
#Define OLECMDEXECOPT_PROMPTUSER 1
#Define OLECMDEXECOPT_DONTPROMPTUSER 2


  DEFINE BUTTON oBtn RESOURCE "STAMPA" OF oBar ;
                      ACTION  oActiveX:Do( "ExecWB", OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER ) ;
                      NOBORDER ;
                      TOOLTIP 'Stampa'
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: error on print from activex

Postby karinha » Fri Dec 04, 2020 1:02 pm

What are you trying to do, something like that?

Code: Select all  Expand view

#include "FiveWin.ch"

#define OLECMDID_PRINT 6
#define OLECMDEXECOPT_PROMPTUSER 1
#define OLECMDEXECOPT_DONTPROMPTUSER 2

FUNCTION Main()

   LOCAL cHtmlOrUrl, nCopies, lShow

   lShow      := .T.
   nCopies    := 1
   cHtmlOrUrl := "http://forums.fivetechsupport.com/viewtopic.php?f=3&t=27933"

   PrintHtml( cHtmlOrUrl, nCopies, lShow )

RETURN NIL

FUNCTION PrintHtml( cHtmlOrUrl, nCopies, lShow )

   STATIC oWnd := nil, oBar, oIe

   LOCAL I

   DEFAULT lShow := .F. , nCopies := 1

   IF oWnd = NIL

      DEFINE WINDOW oWnd

      DEFINE BUTTONBAR oBar OF oWnd

      DEFINE BUTTON OF oBar;
         PROMPT 'Print ';
         ACTION oIe:Do( "ExecWB", OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER )

      oIe = TActiveX():New( oWnd, "Shell.Explorer" )

   ENDIF

   oIe:Do( "Navigate2", cHtmlOrUrl )

   IF lshow

      oWnd:oClient = oIe

      ShowWindow( oWnd, 1 ) // 1=Show,0=hide

      ACTIVATE WINDOW oWnd

      oWnd:Center()

   ELSE

      FOR i = 1 TO nCopies

         MsgWait( 'Printing large receipt (' + alltrim( str(i ) ) + ' of ' + alltrim( str(nCopies ) ) + ' copies).', , 2 )

         oIe:Do( "ExecWB", OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER )

      NEXT i

   ENDIF

   Sysrefresh()

RETURN NIL
 


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7811
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests