Monday 15 February 2010

c++ - wstringstream to LPCWSTR -



c++ - wstringstream to LPCWSTR -

there open source code using , created new string class can have syntax's :

openevent(event_all_access, false, string() << l"sometext" << uint(123));

i wondering if can create same thing conciseness wstringstream or similar.

openevent window api function 3rd argument lpcwstr can phone call like

openevent(event_all_access, false, l"some text");

assuming have wstringstream variable named wss, calling "wss.str().c_str()" trick.

this relies on str fellow member of basic_stringstream class , c_str fellow member of basic_string class. calling str on basic_stringstream object obtains string representation of object , calling c_str on basic_string object obtains c-style string representation of object.

c++ windows winapi stl

No comments:

Post a Comment