General complain about LPWSTR in API instead of LPCWSTR...

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
omascia
User
Posts: 48
Joined: Thu Mar 11, 2010 7:07 pm

General complain about LPWSTR in API instead of LPCWSTR...

Post by omascia »

All over the brand new API, when taking a string as input, it generally is declared LPWSTR (non const), which is a pain in the {you know what :) } when calling them from C++. Why haven't these API been declared to take CONST strings (that is LPCWSTR for instance) when the intent is not to update them anyway?

:?: :?: :?:
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: General complain about LPWSTR in API instead of LPCWSTR.

Post by Roman - Tracker Supp »

Hello omascia,
Actually we use const strings wherever possible in our COM API internal definition.
The problem is that we publish our COM API in the form of MS type library (TLB).
It is universal and makes COM API available for most development environment at the expense of losing some information, including const qualifiers.
omascia
User
Posts: 48
Joined: Thu Mar 11, 2010 7:07 pm

Re: General complain about LPWSTR in API instead of LPCWSTR.

Post by omascia »

Roman - Tracker Supp wrote:Hello omascia,
Actually we use const strings wherever possible in our COM API internal definition.
The problem is that we publish our COM API in the form of MS type library (TLB).
It is universal and makes COM API available for most development environment at the expense of losing some information, including const qualifiers.
Thanks. Unfortunately this leveling down forces C++ teams to add const_cast<> or C-style casts in many places, and though it won't shake earth too badly, it feels wrong, in 2016. :( Maybe that's just me though, so:)
User avatar
Roman - Tracker Supp
Site Admin
Posts: 303
Joined: Sun Nov 21, 2004 3:19 pm

Re: General complain about LPWSTR in API instead of LPCWSTR.

Post by Roman - Tracker Supp »

I agree with you. We will discuss what can be done without breaking backward compatibility.
Post Reply