error C2664: 'setStartupDirectory' : cannot convert parameter

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

error C2664: 'setStartupDirectory' : cannot convert parameter

 
0
  #1
Dec 5th, 2008
Hi

I have a virtual function setStartupDirectory()

virtual bool setStartupDirectory(const SysString &sStartupDirectory) = 0;

When I am calling this function
setStartupDirectory((const SysString &)m_pApplicationFolderNarrow);
I am getting this error
Error 2 error C2664: 'setStartupDirectory' : cannot convert parameter 1 from 'const SysString' to 'const SysString &'

Am I missing something
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: error C2664: 'setStartupDirectory' : cannot convert parameter

 
0
  #2
Dec 5th, 2008
Here..
  1. virtual void CSample1::Sample(SysString str)
  2. (
  3. if(str.empty())
  4. return;
  5. //...
  6. )
  7. virtual void CSample2::Sample(SysString &str)
  8. {
  9. str="what's up";
  10. }
  11. int main()
  12. {
  13. SysString str1="check";
  14. SysString str2;
  15. CSample1 s1;
  16. CSample2 s2;
  17. s1.Sample(str1);
  18. s2.Sample(str2);
  19. return 0;
  20. }
Last edited by cikara21; Dec 5th, 2008 at 3:26 am.
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 46
Reputation: karang is an unknown quantity at this point 
Solved Threads: 0
karang karang is offline Offline
Light Poster

Re: error C2664: 'setStartupDirectory' : cannot convert parameter

 
0
  #3
Dec 5th, 2008
Hi

I have a function
bool setStartupDirectory(const SysString &sStartupDirectory)
{}

Now I want to give the prototype of the function how can I do that
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 8
Reputation: sweeya is an unknown quantity at this point 
Solved Threads: 1
sweeya sweeya is offline Offline
Newbie Poster

Re: error C2664: 'setStartupDirectory' : cannot convert parameter

 
0
  #4
Dec 5th, 2008
You can directly make the call to the function as follows

setStartupDirectory(m_pApplicationFolderNarrow);
Last edited by sweeya; Dec 5th, 2008 at 5:14 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC