Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

How to fix Compile Wrong datatype on vs2019?

$
0
0
Hi,
I have created 4 methods as follows:
Code:

          void Range::WriteValue(CStringW value)
          {
               
          }
          void Range::WriteValue(int value)
          {
               
          }
          void Range::WriteValue(double value)
          {
               
          }
          void Range::WriteValue(bool value)
          {
               
          }

then, I called it by this code :
Code:

Range(L"A1").WriteValue(L"hello world");
but it seem not compiled param L"hello world" as CString but bool,
Is there a way for the compiler to understand I'm using a CString without having to specifically like this:
Code:

Range(L"A1").WriteValue(CString(L"hello world"));
Thanks you!

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images