SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by Cisc » Wed, 09 Jul 2003 03:41:42



Hello,
    does anybody know a way to ge the SHInvokePrinterCommand to do a print
test in WindowsXP?  The PRINTACTION_TESTPAGE parameter works well in other
OS, but not in XP!

I am using VC6 and XP to develop.

Thanks
Cisco

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by David Lownde » Wed, 09 Jul 2003 16:05:43


Quote:>    does anybody know a way to ge the SHInvokePrinterCommand to do a print
>test in WindowsXP?  The PRINTACTION_TESTPAGE parameter works well in other
>OS, but not in XP!

Do you have a short code example that illustrates the problem?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by Cisc » Thu, 10 Jul 2003 01:54:35


Dave,
    here it is.  This works under 98/ME no problem.  After doing somes tests
in 2K and XP.  I think both OS's fails.  Maybe I need to define something
for WIN32_IE?

Thanks
Cisco

bool PrintTestPage(LPCTSTR pcDevice)
{
 HINSTANCE hModule;
 bool  bStatus=false;
 SH_INVOKEPRINTERCOMMAND SH_InvokePrinterCommand;

 hModule =LoadLibrary("shell32.dll");
 if(hMod!=NULL)
 {
  SH_InvokePrinterCommand=(SH_INVOKEPRINTERCOMMAND)GetProcAddress(hMod,
"SHInvokePrinterCommandA");

  if(SH_InvokePrinterCommand!=NULL)
  {
   if(SH_InvokePrinterCommand(GetDesktopWindow(), PRINTACTION_TESTPAGE,
pcDevice, NULL, TRUE)!=FALSE)
    bStatus=true;
  }
  FreeLibrary(hMod);
 }
 return bStatus;

}



Quote:> >    does anybody know a way to ge the SHInvokePrinterCommand to do a
print
> >test in WindowsXP?  The PRINTACTION_TESTPAGE parameter works well in
other
> >OS, but not in XP!

> Do you have a short code example that illustrates the problem?

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by David Lownde » Fri, 11 Jul 2003 07:41:37


Quote:>    here it is.  This works under 98/ME no problem.  After doing somes tests
>in 2K and XP.  I think both OS's fails.

All I can tell you currently is that it doesn't work for me either. I
suspect the documentation is incomplete for use on NT operating
systems - but that's just me guessing. I've tried to raise this issue
with MS to get more information. If I hear anything I'll reply to this
thread.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by Cisc » Fri, 11 Jul 2003 08:04:39


Thanks a bunch!!!

Cisco


Quote:> >    here it is.  This works under 98/ME no problem.  After doing somes
tests
> >in 2K and XP.  I think both OS's fails.

> All I can tell you currently is that it doesn't work for me either. I
> suspect the documentation is incomplete for use on NT operating
> systems - but that's just me guessing. I've tried to raise this issue
> with MS to get more information. If I hear anything I'll reply to this
> thread.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by David Lownde » Fri, 11 Jul 2003 15:50:55


Quote:>If I hear anything I'll reply to this thread.

I should have added - it might take a while to get a reply, so if you
need an answer sooner rather than later, you'll need to contact MS
PSS.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by Cisc » Sat, 12 Jul 2003 00:42:46


I have found an "interim" way to send the test page in Win2K and XP for now.
I belive the SHInvokePrinterCommand should be the way to go for all OS's.
But we shall see if that will be possible.

Thanks
Cisco


Quote:> >If I hear anything I'll reply to this thread.

> I should have added - it might take a while to get a reply, so if you
> need an answer sooner rather than later, you'll need to contact MS
> PSS.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by David Lownde » Sat, 12 Jul 2003 01:09:26


Quote:>I have found an "interim" way to send the test page in Win2K and XP for now.

Can you tell us what you've done - so that anyone else who comes
across this problem can benefit from your experience?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

SHInvokePrinterCommand with PRINTACTION_TESTPAGE fails in XP

Post by Cisc » Sat, 12 Jul 2003 05:46:35


Dave,
    I used the following to get the test page to work in 2K and XP.  It
appears that this DLL has a ton of other functionality that is useful as
well.

This will get you all of the possible parameters
rundll32 printui.dll,PrintUIEntry /?

This will get you a test print to a desired printer "Printer Name".
rundll32 printui.dll,PrintUIEntry /k /n "My Printer Name"

Cisco


Quote:> >I have found an "interim" way to send the test page in Win2K and XP for
now.

> Can you tell us what you've done - so that anyone else who comes
> across this problem can benefit from your experience?

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq

 
 
 

1. Acrobat SDK -- example plug-ins fail with C++.net compiler

Hi All

I have compiled a few of the Acrobat SDK example
plug-ins both with Visual C++ 6.0 and Visual C++ .net.
Although they compile fine with both systems, only those
compiled with Visual C++ 6.0 successfully register
with Acrobat. The VC++ .net versions are immediately
unloaded. I know the SDK recommends
VC++ 6.0 but I was wondering if anyone knows why
they all fail with the .net version -- and can it be fixed
easily?

Many thanks

Graham

2. JOB: Game Programmers wanted in GERMANY

3. Paperport 8.0 Fails on Windows XP Professional

4. comp.dcom.isdn FAQ Part 2 of 5: General Topics

5. service pack1 downloads xp keeps failing

6. My mother wants a BBC....

7. Windows XP and my failed .NET

8. survey says xbox to sell more.

9. CreateFile fails on XP after another intermediate driver is installed

10. Fail to generate nms file when build with XP DDK

11. Asking again: Assertion in XP - *** Assertion failed: ...

12. Assertion in XP - *** Assertion failed: (PsGetCurrentThread()->StartAddress != (PVOID)KeBalanceSetManager) || (ARGUMENT_PRESENT(Timeout))

13. PPC target: elfHex fails - malloc failed, Error 0xffffffff