[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.0

VC++ mfc convert  from 'LPTSTR' to 'const char *'

Asked by shaf81 in Microsoft Visual C++.Net, Video Editing, Audio Editing

Tags: VC++ mfc convert from 'LPTSTR' to 'const char *

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 ?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
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 ==========
 
Related Solutions
Keywords: VC++ mfc convert from 'LPTSTR' …
 
Loading Advertisement...
 
[+][-]08/21/08 09:27 AM, ID: 22281255Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Visual C++.Net, Video Editing, Audio Editing
Tags: VC++ mfc convert from 'LPTSTR' to 'const char *
Sign Up Now!
Solution Provided By: vtladiadi
Participating Experts: 1
Solution Grade: B
 
[+][-]08/15/08 09:18 AM, ID: 22239477Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/08 03:08 AM, ID: 22250502Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/08 08:53 AM, ID: 22253009Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/18/08 11:29 PM, ID: 22257579Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/18/08 11:50 PM, ID: 22257635Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/08 07:08 AM, ID: 22259883Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/19/08 11:28 PM, ID: 22266680Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/08 11:41 PM, ID: 22266734Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/20/08 11:07 AM, ID: 22272308Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/21/08 07:07 AM, ID: 22279666Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/21/08 11:32 PM, ID: 22287339Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 / EE_QW_2_20070628