Advertisement

08.14.2008 at 07:57AM PDT, ID: 23648339
[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, Audio Editing, Video Editing

Tags:

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 ?
Start Free Trial
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 ==========
[+][-]08.15.2008 at 09:18AM PDT, ID: 22239477

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2008 at 03:08AM PDT, ID: 22250502

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.18.2008 at 08:53AM PDT, ID: 22253009

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.18.2008 at 11:29PM PDT, ID: 22257579

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.18.2008 at 11:50PM PDT, ID: 22257635

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 07:08AM PDT, ID: 22259883

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 11:28PM PDT, ID: 22266680

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.19.2008 at 11:41PM PDT, ID: 22266734

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.20.2008 at 11:07AM PDT, ID: 22272308

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 07:07AM PDT, ID: 22279666

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2008 at 09:27AM PDT, ID: 22281255

View this solution now by starting your 7-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, Audio Editing, Video Editing
Tags: VC++ mfc convert from 'LPTSTR' to 'const char *
Sign Up Now!
Solution Provided By: vtladiadi
Participating Experts: 1
Solution Grade: B
 
 
[+][-]08.21.2008 at 11:32PM PDT, ID: 22287339

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628