Skip navigation
PK_Developer
Currently Being Moderated

Using ShellExecuteEx to shell out to the Reader in version 9 vs X?

Apr 16, 2012 12:32 PM

Tags: #reader #sdk #acrobat_x #acrobat_reader #acrobat-sdk

I have a question:

 

VC++ v6.0 w/MFC is my langauge":
In my code, when I shell out to run "printto" in version 9, it works just fine, but when I shell out to run "printto" in version 10, it does not send the information to the selected printer at all.  If I then de-install Reader X and re-install version 9, it works perfectly again.  I can run the same test against locally installed printers both LPT and USB, network printers, and even shared printers on neighboring desktops.  Identical results.


In my code, I monitor the printer queue, and I can verify that it never shows up.  There is no change in my code between the two versions.  One works and the other doesn't.  No change in client computer or configuration either, other than Acrobat Reader versions.


Could this somehow be due to DDE Server Application names changing?

 

Sample Code:

 

// szExecVerb = "printto"

// lpszFile = full path to the pdf file name

// lpszExecParam = "<printer_name>" "<driver>" "<port>"

// ##Example: "network_printer50" "spooler" "ne04"

// Whatever it is, it is identical when running with Acrobat Reader version 9 vs Reader X.

// Also, these parameters are validated and traced.

 

  //launch the application to print the file

  SHELLEXECUTEINFO sei;

  memset((LPVOID) &sei, NULL, sizeof(sei));

  sei.cbSize = sizeof(sei);

  sei.fMask = SEE_MASK_NOCLOSEPROCESS |  SEE_MASK_FLAG_DDEWAIT | SEE_MASK_DOENVSUBST;

  sei.lpVerb = szExecVerb;

  sei.lpFile = lpszFile;

  sei.lpParameters = lpszExecParm;

  sei.nShow = SW_MINIMIZE;

  BOOL fSuccess = ShellExecuteEx(&sei);

 

I then wait for the document to show up in the selected printer's queue.  Needless to say it never shows up when using Reader X, but works fine in Acrobat Reader version 9. 

 

Anything you might offer could be helpful.  Are others not having this problem?

 

Is there anything I else I could provide to help with figuring out why it just stops working?

 
Replies
  • Currently Being Moderated
    Apr 16, 2012 1:05 PM   in reply to PK_Developer

    Yes, as documented in the SDK, the DDE names have changed.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2012 11:37 PM   in reply to PK_Developer

    Doing your own DDE is more reliable.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 18, 2012 2:14 PM   in reply to PK_Developer

    I believe the print to verb has been eliminated for security considerations.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points