0

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

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by sweeya
0

Here..

virtual void CSample1::Sample(SysString str)
(
   if(str.empty())
      return;
   //...
)
virtual void CSample2::Sample(SysString &str)
{
   str="what's up";
}
int main()
{
   SysString str1="check";
   SysString str2;
   CSample1 s1;
   CSample2 s2;
   s1.Sample(str1);
   s2.Sample(str2);
   return 0; 
}
0

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

0

You can directly make the call to the function as follows

setStartupDirectory(m_pApplicationFolderNarrow);

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.