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?
General complain about LPWSTR in API instead of LPCWSTR...
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.
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.
- Roman - Tracker Supp
- Site Admin
- Posts: 306
- Joined: Sun Nov 21, 2004 3:19 pm
Re: General complain about LPWSTR in API instead of LPCWSTR.
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.
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.
Re: General complain about LPWSTR in API instead of LPCWSTR.
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:)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.
- Roman - Tracker Supp
- Site Admin
- Posts: 306
- Joined: Sun Nov 21, 2004 3:19 pm
Re: General complain about LPWSTR in API instead of LPCWSTR.
I agree with you. We will discuss what can be done without breaking backward compatibility.