Advertisement

04.01.2008 at 01:11PM PDT, ID: 23287096
[x]
Attachment Details

const *obj  & broken in Visual C++ 2005

Asked by Olav00007 in Microsoft Visual C++.Net, Microsoft Visual C++

Tags: Visual C++ 2005, error C2664: 'usedToWork' : cannot convert parameter 1 from 'CString *' to 'const CString *&'

The code below used to work until VC++ 2003, but I get error-message in VC++ 2005.
(Sitting here, I can see that it perhaps doesnt like that I could "return"  a const CString*, that it wont let me assign to a CString*, but that is not consistent with the error message)


static void
usedToWork (const CString* &field)
{
 
}


static void
callUsedToWork()
{
 CString* notconstP = new CString("notconst");
 usedToWork( notconstP);
}

Start Free Trial
 
Loading Advertisement...
 
[+][-]04.01.2008 at 11:34PM PDT, ID: 21260572

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.

 
[+][-]05.27.2008 at 07:04PM PDT, ID: 21657223

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

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

 
[+][-]05.27.2008 at 10:49PM PDT, ID: 21657944

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.

 
[+][-]05.30.2008 at 02:47PM PDT, ID: 21681655

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.

 
[+][-]05.31.2008 at 12:01AM PDT, ID: 21682940

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, Microsoft Visual C++
Tags: Visual C++ 2005, error C2664: 'usedToWork' : cannot convert parameter 1 from 'CString *' to 'const CString *&'
Sign Up Now!
Solution Provided By: Gurudenis
Participating Experts: 1
Solution Grade: B
 
 
[+][-]06.01.2008 at 04:14AM PDT, ID: 21686594

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