error C2664

  • Follow


Hi,

  I have to a project which I am converting it to Unicode.  I am
getting following error.  I am not sure How to fix it.

error C2664: 'LogFile::LogToFile' : cannot convert parameter 1 from
'const unsigned short [65]' to 'std::string'

The code is
#define MAIN_LOG_FILE ".\\ABC.log"

Defination LogToFile(std::string message, std::string fileName);

I am calling this LogToFile("My Name", MAIN_LOG_FILE)

I have tried using "L" and "_T"  It is not working.

Can you please help?
Thanks
0
Reply Samant.Trupti (36) 8/1/2008 12:33:29 PM

Samant.Trupti@gmail.com wrote:
>   I have to a project which I am converting it to Unicode.  I am
> getting following error.  I am not sure How to fix it.
> 
> error C2664: 'LogFile::LogToFile' : cannot convert parameter 1 from
> 'const unsigned short [65]' to 'std::string'
> 
> The code is
> #define MAIN_LOG_FILE ".\\ABC.log"
> 
> Defination LogToFile(std::string message, std::string fileName);
> 
> I am calling this LogToFile("My Name", MAIN_LOG_FILE)
> 
> I have tried using "L" and "_T"  It is not working.
> 
> Can you please help?

Perhaps you should try 'std::wstring'...

V
-- 
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
0
Reply v.Abazarov (13255) 8/1/2008 12:40:02 PM


On Aug 1, 5:40=A0pm, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
> Samant.Tru...@gmail.com wrote:
> > =A0 I have to a project which I am converting it to Unicode. =A0I am
> > getting following error. =A0I am not sure How to fix it.
>
> > error C2664: 'LogFile::LogToFile' : cannot convert parameter 1 from
> > 'const unsigned short [65]' to 'std::string'
>
> > The code is
> > #define MAIN_LOG_FILE ".\\ABC.log"
>
> > Defination LogToFile(std::string message, std::string fileName);
>
> > I am calling this LogToFile("My Name", MAIN_LOG_FILE)
>
> > I have tried using "L" and "_T" =A0It is not working.
>
> > Can you please help?
>
> Perhaps you should try 'std::wstring'...
>
> V
> --
> Please remove capital 'A's when replying by e-mail
> I do not respond to top-posted replies, please don't ask- Hide quoted tex=
t -
>
> - Show quoted text -

Yes That what I did next.  It works.  Thanks
0
Reply Samant.Trupti (36) 8/1/2008 1:59:56 PM

2 Replies
30 Views

(page loaded in 0.044 seconds)

Similiar Articles:






7/28/2012 12:17:07 AM


Reply: