I passed values for below function:-
HANDLE PortSIP_initialize(SIPCallbackEvent * callbackEvent,
int maxLines,
const char * userName,
const char * authName,
const char * password,
const char * agent,
const char * localIP,
int localSIPPort,
const char * userDomain,
const char * proxyServer,
int proxyServerPort,
const char * outboundServer,
int outboundServerPort,
const char * STUNServer,
int STUNServerPort);
Below is the passed values:-
m_siplib = PortSIP_initialize(m_sipevent, 8, (LPTSTR)(LPCTSTR)m_username,
(LPTSTR)(LPCTSTR)m_username,
(LPTSTR)(LPCTSTR)m_password,
"PortSIP VoIP SDK 4.0",
localIP, SIPPort,
/*(LPTSTR)(LPCTSTR)m_UserDomain*/"",
(LPTSTR)(LPCTSTR)m_sipserver,
/*m_serverport*/"",
/*(LPTSTR)(LPCTSTR)m_OutboundServer*/"",
/*m_OutboundServerPort*/"",
/*(LPTSTR)(LPCTSTR)m_StunServer*/"",/*m_STUNSERVERPORT*/
m_stunserverport);
When I compiled then give below Error message in code.
error C2664: 'PortSIP_initialize' : cannot convert parameter 3 from 'LPTSTR' to 'const char *' and when I double clicked the error the error code pointer point to the last parameter.
When I hard code the parameter 3 with " "janith" " then give error message,
'PortSIP_initialize' : cannot convert parameter 4 from 'LPTSTR' to 'const char *'
Then also error pointer point to last variable.
I use "Visual Studio 2005" with Operating system "Windows XP" and use "MFC" with Vsual C++.
How can I find the cause ? and fix it ?
sample Output
1>------ Build started: Project: dialler_sample_1, Configuration: Debug Win32 ------
1>Compiling...
1>dialler_sample_1Dlg.cpp
1>e:\sip\sip_2\dialler_sample_1\dialler_sample_1\dialler_sample_1dlg.cpp(227) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
1>e:\sip\sip_2\dialler_sample_1\dialler_sample_1\dialler_sample_1dlg.cpp(384) : error C2664: 'PortSIP_initialize' : cannot convert parameter 4 from 'LPTSTR' to 'const char *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Build log was saved at "file://e:\sip\sip_2\dialler_sample_1\dialler_sample_1\Debug\BuildLog.htm"
1>dialler_sample_1 - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
Select allOpen in new window
by: vtladiadiPosted on 2008-08-15 at 09:18:39ID: 22239477
what types are m_username and m_password?