No printing if only API calls to form 
Author Message
 No printing if only API calls to form

I am new to making API calls from VB6.

If I get the hDC to the printer (Printer.hDC) and use only TextOut and
MoveToEx/LineTo, I seem to get no printed output.  However, if I stick in
some VB output to the printer (e.g., Printer.Line (0,0)-(100,100) ),
anything sent to the printer using the TextOut/LineTo after the Printer.Line
works OK.

Is it possible to write to a printer using only API calls, e.g.:
  hDC = Printer.hDC
  < API calls >
  Printer.NewPage
  Printer.EndDoc

There's something to be learned here, but I haven't uncovered it yet
(believe me, it was detective work aplenty to get this far!).

Would appreciate any info.

Thanks,
Dave



Tue, 27 May 2003 13:03:46 GMT  
 No printing if only API calls to form
You can't mix the Printer object methods with the API methods (at least not
if you want consistent results!).  You need to use some more API functions
to do the new page and end doc stuff.  Sorry I don't know what they are
(never used 'em myself).

Jim Deutch
MS Dev MVP


Quote:
> I am new to making API calls from VB6.

> If I get the hDC to the printer (Printer.hDC) and use only TextOut and
> MoveToEx/LineTo, I seem to get no printed output.  However, if I stick in
> some VB output to the printer (e.g., Printer.Line (0,0)-(100,100) ),
> anything sent to the printer using the TextOut/LineTo after the
Printer.Line
> works OK.

> Is it possible to write to a printer using only API calls, e.g.:
>   hDC = Printer.hDC
>   < API calls >
>   Printer.NewPage
>   Printer.EndDoc

> There's something to be learned here, but I haven't uncovered it yet
> (believe me, it was detective work aplenty to get this far!).

> Would appreciate any info.

> Thanks,
> Dave



Wed, 28 May 2003 00:03:12 GMT  
 No printing if only API calls to form
A few years ago I asked Microsoft Support about this and they said that you
had to initialize the printer before using API calls.  They suggested
printing a blank using Printer.Print " "

I've not had any trouble using the Printer methods NewPage and EndDoc in the
midst of API calls.

Keith Rebello



Mon, 02 Jun 2003 06:49:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. No printing if only API calls to form?

2. Activate Form / Deactivate Form API Call

3. Vertical Print & API Form Printing

4. API Calls/Printing with Adobe PDF Writer

5. API Calls to Check Print Spooler is Empty

6. Printing from VB API calls?

7. API calls & printing

8. NEED PRINTING API CALLS FOR NT

9. Printing problems with VB and CR7 API calls

10. Printing Crystal Reports without Crystal Control ActiveX or Crystal Reports API call

11. API call to print to file

12. WIN API Call To Check Print Queue?

 

 
Powered by phpBB® Forum Software