RSS Forums RSS

error C2664: 'setStartupDirectory' : cannot convert parameter

Please support our C++ advertiser: Programming Forums
Thread Solved
Reply
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

  #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
AddThis Social Bookmark Button
Reply With Quote  
Posts: 314
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 61
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

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

  #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 2:26 am.
.:-cikara21-:.
Reply With Quote  
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

  #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  
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

  #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 4:14 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 290 | Replies: 3 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:21 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC