Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT

$
0
0

Hello smart people! :-)

I'm kind of new at using Visual Studio but I have code that I need to compile. I have knowledge that it had compiled fine in the older versions of VS but I haven't been able to do so in VS 2005, 2008, 2010.

It's giving me the following errors :

-------------------------------------------------

"Error    2    error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<_CharType>>>' "

"    3    IntelliSense: more than one constructor applies to convert from "int" to "ATL::CStringT<char, StrTraitMFC_DLL<char, ATL::ChTraitsCRT<char>>>":
            function "ATL::CStringT<BaseType, StringTraits>::CStringT(char ch, int nLength = 1) [with BaseType=char, StringTraits=StrTraitMFC_DLL<char, ATL::ChTraitsCRT<char>>]"
            function "ATL::CStringT<BaseType, StringTraits>::CStringT(wchar_t ch, int nLength = 1) [with BaseType=char, StringTraits=StrTraitMFC_DLL<char, ATL::ChTraitsCRT<char>>]"   c:\Users\mhk834\Source\Workspaces\MC\MCDDownload\ThreadSupport.cpp    57    25    MCDDL

-----------------------------------------------------

there is too much code to be able to paste here so I'll just paste the parts which are affected:

CString Smart_Enabled = 1;

...................

    if (Smart_Enabled == "1")
    {
        m_hStationConfigure = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LoadLocalFilesThread,this, 0,  &dwThreadID);
        TRACE("Started LoadLocalFilesThread 0x%X\n", dwThreadID);

        CWnd* pWnd = GetDlgItem(IDC_EDIT_SMART_MODE);
        m_strSmartMode = ("Smart - %s", m_strSmartMode);
        pWnd->SetWindowText(m_strSmartMode);

..........................

strItem="SMART_ENABLED";
    if ((GetIniValue(strItem, Smart_Enabled)) == false)
    {
        pMainDlg->AddText(dwIDCmsg,"SMART_ENABLED setting in MCDUSBDL.ini \r\nnot found\r\n");
    }

...................................

I've been looking all over the place for help but no luck. I'm really stumped on this one so any help would be greatly appreciated!!

If anything else is needed from my side just let me know :-)

Thanks!


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>