Re: TAPI how to get the device Name
- From: imhotep <imhotep@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Aug 2009 16:14:01 -0700
So what is the function of ITAddress->GetAddressName(BSTR ppName)?
that is the functon I have been using,
"Andreas Marschall [exMVP TAPI]" wrote:
"imhotep" <imhotep@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag.
news:E41B0FA5-45F9-472E-AC40-0614466E9861@xxxxxxxxxxxxxxxx
Ok, i think am getting the TAPI and VC++ now,
I would like to output the device name to the console..
but for some reason i only get the mem address or hex
am using pAddress->AddressNam(&ppName)
when I try to output ppName, I get hex or address location
imhotep,
please note that dwAddressOffset is: "Offset from the beginning of the
structure to the variably sized address field. The size of the field is
specified by dwAddressSize."
So to access the string you need to do some pointer arithmetics and type
castings:
LONG lRet = lineGetAddressCaps(,,,,,lpAddressCaps);
// check return code and process possible errors
// check if (lpAddressCaps->dwTotalSize < lpAddressCaps->dwNeededSize) and
reallcoate more memory for lpAddressCaps before retrying
lineGetAddressCaps()
char* sAddress =
(char*)(((BYTE*)lpAddressCaps)+lpAddressCaps->dwAddressOffset);
// when using sAddress it is strongly recommended to access it only upto its
valid length: lpAddressCaps->dwAddressSize bytes.
--
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.
- Follow-Ups:
- Re: TAPI how to get the device Name
- From: Andreas Marschall [exMVP TAPI]
- Re: TAPI how to get the device Name
- Next by Date: Re: TAPI how to get the device Name
- Next by thread: Re: TAPI how to get the device Name
- Index(es):
Relevant Pages
|