Ticket URL: <
http://trac.wxwidgets.org/ticket/14338#comment:3>
#14338: Helpers to convert wxString to LPCTSTR, LPTSTR and LPARAM
---------------------+------------------------------------------------------
Reporter: kosenko | Owner:
Type: defect | Status: confirmed
Priority: low | Milestone:
Component: wxMSW | Version: 2.9-svn
Keywords: | Blockedby:
Patch: 1 | Blocking:
---------------------+------------------------------------------------------
Changes (by vadz):
* cc: vaclavslavik (added)
Comment:
I did think about it but IMO the fact that currently we always cache the
conversion results is just an optimization and could change in the future,
while if we add these functions we sign to always having these buffers
inside it forever because there is no way to implement them otherwise. I'm
not sure if this is wise. The only doubt in my mind is whether we're not
already committed to having this cache anyhow... I do know this is the
case for `char*` buffer but not certain about `wchar_t*`. Vaclav, do you
know/remember if we must have this buffer anyhow and so if it's safe to
return a pointer to it ("safe" in the sense of not regretting it in the
future, I do know that it is safe in the sense of not getting a dangling
pointer right now)?
Also, if it is safe, then we should just change `t_str()` itself to return
either `char*` or `wchar_t*` depending on the build, there is no need to
have a separate `wxConvertToLPCTSTR()` then.
--
Ticket URL: <
http://trac.wxwidgets.org/ticket/14338#comment:3>