Why is the document name in Lock/Unlock not Unicode/LPCTSTR

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Hi!

Why is the document name in Lock/Unlock not Unicode/LPCTSTR?

Definition in both 4.0 and 4.5 version (LPCSTR instead of LPCTSTR):

Code: Select all

/********** Print Job Locking Functions **********/
int WINAPI Lock(HANDLE hPrinter, LPCSTR szLockName);
int WINAPI Unlock(HANDLE hPrinter, LPCSTR szLockName, long dwTimeout);
The JobInfo structure in Windows uses Unicode name fror document name:

Code: Select all

typedef struct _JOB_INFO_1 {
  DWORD      JobId;
  LPTSTR     pPrinterName;
  LPTSTR     pMachineName;
  LPTSTR     pUserName;
  LPTSTR     pDocument;
  LPTSTR     pDatatype;
  LPTSTR     pStatus;
  DWORD      Status;
  DWORD      Priority;
  DWORD      Position;
  DWORD      TotalPages;
  DWORD      PagesPrinted;
  SYSTEMTIME Submitted;
} JOB_INFO_1, *PJOB_INFO_1;
Regards

Aldus@Monitor
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Jose »

Hello,

I have discussed this situation with our development team and they are going add Unicode support for the document name parameter of the Lock\Unlock functions to our next release.

This should be available later on this summer.

Hope this helps?
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Great :-)

Do you know what version number will be used in that release? (4.5/4.6 or 5.x?)

/Aldus
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Jose wrote:This should be available later on this summer.
Hello,

Has this fix been released? What version number?

/Aldus
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

I see that version 4.5.2.9 is released recently but the Unicode version of Lock/Unlock/TestLock is still missing.
Any news?
We are trying to hold out but customer preassure (to fix the Terminal Server issues without locking) is increasing.

/Aldus
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Any news of when and in what version this will be fixed?

/MrK
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Please provide some kind of estimate when this problem can be solved!

/MrK
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Just downloaded AmyUni 4.5.3.1 to check if problem was solved. No change at all to CdIntf.h. :(
So problem persists.
Locking for use on a terminal server is still impossible.

Regards

Aldus@Monitor
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Just downloaded AmyUni 4.5.3.3 to check if problem was solved. No change at all to CdIntf.h. :(
So problem persists.
Locking for use on a terminal server is still impossible!!!

Regards

Aldus@Monitor
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

Just downloaded AmyUni 4.5.3.5 to check if problem was solved. No change at all to CdIntf.h since 2012-05-30 :(
So problem persists.
Locking for use on an international terminal server is still impossible!!!

Regards

Aldus@Monitor
Yoisel
Amyuni Team
Posts: 5
Joined: Thu Sep 10 2009

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Yoisel »

This has been implemented in the upcoming Amyuni PDF Converter 5.0.

Thanks.
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

That is great news!

Any timeframe for the release of version 5.x?

Regards
Aldus
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Aldus@Monitor »

I saw 5.0 was released at 4. of June 2013. We are now testing the new Lock/Unlock calls.

Regards
Aldus
Devteam
Posts: 119
Joined: Fri Oct 14 2005
Location: Montreal
Contact:

Re: Why is the document name in Lock/Unlock not Unicode/LPCTSTR

Post by Devteam »

Note that you need to use the wide string versions of these functions when using DLL calls:
int WINAPI LockW(HANDLE hPrinter, LPCWSTR szDocTitle);
int WINAPI UnlockW(HANDLE hPrinter, LPCWSTR szDocTitle, long dwTimeout);
int WINAPI SetDocFilePropsW(HANDLE hPrinter, LPCWSTR szDocTitle, long lOptions, LPCWSTR szFileDir, LPCWSTR szFileName);

When using the ActiveX control, no code change is required and you can directly use Unicode strings.
Amyuni Development Team

Efficient and accurate conversion to PDF, XPS, PDF/A and more. Free trials at - https://www.amyuni.com
Post Reply