Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TSPs and CHAR, WCHAR, MultiByte, Unicode, ...

4 views
Skip to first unread message

Klaus Darilion

unread,
Nov 12, 2009, 11:52:49 AM11/12/09
to
Hi!

Sorry for my ignorance about string handling in Windows, but I just
wonder how strings are/should be handled in TSPs.

The atsp32 sample uses WideCharToMultiByte() to convert the
lpszDestAddress. On the other hand I had to replace _vsnwprintf with
_vsnprintf to make the sample print the log messages.

Thus, is the a certain character format to be used in TSPs?
Is it a build option? (if yes, any recommendations?)

Thanks
Klaus

Andreas Marschall [exMVP TAPI]

unread,
Nov 12, 2009, 1:33:58 PM11/12/09
to
"Klaus Darilion" <klaus.mai...@pernau.at> schrieb im Newsbeitrag
news:%239ydSi7...@TK2MSFTNGP02.phx.gbl...

> Thus, is the a certain character format to be used in TSPs?
> Is it a build option? (if yes, any recommendations?)

Klaus,
within your TSP you can use what ever string format you want,
but when exchanging data on TSPI you *always* have use 16-bit Unicode
characters (i.e WCHAR, LPWSTR) for strings either as input and output (e.g.
TSPI_lineMakeCall's lpszDestAddress and LINECALLINFO's dwCallerID)..
So to minimize conversions (like WideCharToMultiByte() /
MultiByteToWideChar()) you may want to use TSP internally 16-bit Unicode
characters too.

--
Best Regards
Andreas Marschall
Microsoft MVP for TAPI / Windows SDK / Visual C++ 2003-2008
TAPI / TSP Developer and Tester
My TAPI and TSPI FAQ:
http://www.I-B-A-M.de/Andreas_Marschall's_TAPI_and_TSPI_FAQ.htm
My Toto� Tools (a collection of free, mostly TAPI related tools):
http://www.i-b-a-m.de/Andreas_Marschall's_Toto_Tools.htm
TAPI development around the world (Frappr! map):
http://www.frappr.com/TAPIaroundTheWorld
* Please post all messages and replies to the newsgroup so all may
* benefit from the discussion. Private mail is usually not replied to.
* This posting is provided "AS IS" with no warranties, and confers no
rights.

0 new messages