Re: API PrntDlg function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance





"Mike Williams" wrote:
Hi Mike Williams
In reply to your helpful post the truthful answer is I do not know,
as I have said before I am a self taught newbie.
The post was because on a previous post it was said "I do not use Common
Dialog I use API's" so thats why I posted this question.

All of my printing has been created from information posted by you in
examples etc. I want to improve my project should I move on to to all API's?
if yes I will have to get a book.

Lay it on the line I will not be offended.

Ron
"LondonLad" <LondonLad@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:06ABD7AB-7132-4291-A40F-936E15453822@xxxxxxxxxxxxxxxx

I downloaded the DLL [vbprndlg] and put in the correct folder
and I have created the little program as instructed and I mostly
understand how that works. Is that all I have to do

You're supposed to also follow the instructions to register the DLL using
Regsvr32. Have you done that, and did you get a "success" message? When you
have done that, and in order to use the dll, you should start a new VB
project (one Form containing a Command Button) and use the Project /
References menu to set a reference to Microsoft VB Printer Dialog, which you
should find in the scrollable list if you registered the DLL properly. Then
you can paste the example code from the page where you downloaded the dll
into the Command Button's Click event and then run your code and click the
button. Does the example VB code run okay on your machine, and does it show
a printer dialog and write some results to the Debug window when you click
the Command Button?

I thought I would have to also use some API's I am
somewhat confussed, can you put me right please [1]

There was once a rather large block of code on the MSDN pages which used
various API functions to display a printer dialog and it included some code
allowing you to set up various start parameters for the dialog and to read
the results after your user had made his selections in it. The vbprndlg.dll
which you downloaded is an alternative way of doing the same thing. It does
more or less the same job without requiring you to use any API functions.
The code as it stands (the code example at the link where you just
downloaded the DLL) does not actually print anything, it merely sets the VB
Printer Object to the printer chosen in the dialog and transfers various
user settings (orientation, copies, etc) to it. In order to actually print
anything to the chosen printer you still need to use the VB Printer Object
printing methods in the normal way.

I thought I would have to also use some API's [2]

Just to make sure we're both talking about the same thing, in your original
post in this thread you said that you wanted to convert your printing from
the CommonDialog to the API. Did you mean that you wanted to use an API
printer dialog instead of the CommonDialog Control's printer dialog, so that
you could eliminate some of the shortcomings of the CommonDialog Control,
but that you wanted to still do your actual printing using the VB Printer
Object? Or did you perhaps mean that you wanted to do everything concerning
your printing, including showing the dialog and perfoming the actual print
job itself, using the various API methods and without using the VB Printer
Object at all?

Mike




.



Relevant Pages

  • Re: API PrntDlg function
    ... When you have done that, and in order to use the dll, you should start a new VB project and use the Project / References menu to set a reference to Microsoft VB Printer Dialog, which you should find in the scrollable list if you registered the DLL properly. ... There was once a rather large block of code on the MSDN pages which used various API functions to display a printer dialog and it included some code allowing you to set up various start parameters for the dialog and to read the results after your user had made his selections in it. ... The code as it stands does not actually print anything, it merely sets the VB Printer Object to the printer chosen in the dialog and transfers various user settings to it. ... Just to make sure we're both talking about the same thing, in your original post in this thread you said that you wanted to convert your printing from the CommonDialog to the API. ...
    (microsoft.public.vb.general.discussion)
  • Re: Re:Stop Printing
    ... > I am printing about 100 pages and if for some reason I want to stop ... > Is there an API that can Cancel any printing on a printer. ... If using VB's Printer object, ...
    (microsoft.public.vb.winapi)
  • Re: RUNDLL32.EXE
    ... 0x66800000 0x155000 Windows Shell Common Dll ... 0x75FA0000 0xA000 BSD Socket API for Windows ... 0x794D0000 0x15000 Microsoft WinSock Extension APIs ...
    (comp.security.firewalls)
  • Re: ZoneAlarm -- Alert for "Run a DLL"
    ... I am blocking it from accessing the internet also... ... DLL file called SENSAPI.DLL. ... 0x60000000 0x5000 SENS Connectivity API DLL ... 0x794D0000 0x15000 Microsoft WinSock Extension APIs ...
    (comp.security.firewalls)
  • Re: Polymorphism using DLL Declares?
    ... same API. ... MustOverride prototypes for the DLL calls, ... SecondDll, and ThirdDll, and have the Declares override the DLL api ... Public MustInherit Class PublicApi ...
    (microsoft.public.dotnet.languages.vb)