HI All,
I had written a dll in c++ for retreiving the IMEI no if the
mobile and was using the dll in a C# app to get the IMEI no. I ran
into a bug in my program . When i tried to debug i found the follwing
error i will paste the code here.
in C++ DLL
DWORD GetTSPLineDeviceID(const TCHAR*
const psTSPLineName)
{
DWORD dwReturn = -1;
for(DWORD dwCurrentDevID = 0 ; dwCurrentDevID < dwNumDevs ;
dwCurrentDevID++)
{
LINEEXTENSIONID LineExtensionID;
if( lineNegotiateAPIVersion(hLineApp, dwCurrentDevID,
TAPI_API_LOW_VERSION,
TAPI_CURRENT_VERSION,
&dwAPIVersion,
&LineExtensionID) == 0 )
{
flag=201;
LINEDEVCAPS LineDevCaps;
LineDevCaps.dwTotalSize = sizeof(LineDevCaps);
if( ::lineGetDevCaps(hLineApp, dwCurrentDevID,
dwAPIVersion, 0, &LineDevCaps) == 0 )
{
flag=202;
BYTE* pLineDevCapsBytes = new
BYTE[LineDevCaps.dwNeededSize];
if(0 != pLineDevCapsBytes)
{
flag=203;
LINEDEVCAPS* pLineDevCaps =
(LINEDEVCAPS*)pLineDevCapsBytes;
pLineDevCaps->dwTotalSize = LineDevCaps.dwNeededSize;
if( ::lineGetDevCaps(hLineApp, dwCurrentDevID,
dwAPIVersion, 0,
pLineDevCaps) == 0 )
{
flag=204;
if(_tcscmp((TCHAR*)
((BYTE*)pLineDevCaps+pLineDevCaps->
dwLineNameOffset), psTSPLineName) == 0 )
{
flag=205;
dwReturn = dwCurrentDevID;
}
}
delete[] pLineDevCapsBytes;
}
}
}
}
return dwReturn;
}
I had passed CELLTSP_LINENAME_STRING as the argument to this function.
The flag value was set to 204 indicating that the _tcscmp() failed.
If anybody knows what the problem is please reply.......
Thanks in advance
Archived from group: microsoft>public>smartphone