Creating a Handle to DEVNAMES and DEVMODE

I have created a handle to DEVNAMES and assigned it to printDlg.  Do I also have to create a handle to DEVMODE and assign it to printDlg?  If so, Why?
paulcaAsked:
Who is Participating?
 
nietodConnect With a Mentor Commented:
>> Do I also have to create a handle to
>> DEVMODE and assign it to printDlg?
No you don't HAVE to.  You can if you need to.  You can either create a DEVNAMES in global memory and store the handle to it int he PRINTDLG structure or you can specify NULL for the handle in the structure.  

However, if you don't create the global memory to store the DEVNAMES, then the print dialog will and will return a handle to it in the PRINTDLG.  So even if you don't allocate this DEVNAMES, you must delete it when done.
0
 
paulcaAuthor Commented:
I am using Visual C++ 4.2.
0
 
nietodCommented:
Note, you might want to upgrade to VC 6.  It is a much nicer compiler and it has fer better on-line help, it might make this sort of thing clearer.  (Although 4.2 had good help.)
0
All Courses

From novice to tech pro — start learning today.