Monday, 15 April 2013

Unable to Initialize Slider Control Variable in MFC Visual .NET 2008 -



Unable to Initialize Slider Control Variable in MFC Visual .NET 2008 -

i created ordinary vertical slider variable in mfc visual .net 2008. when seek initialize slider command variable phone call "m_vsliderbar" through next lines of codes

m_vsliderbar.setrange(0, 100, true); m_vsliderbar.setpos(0); m_vsliderecho.format("%d", 0);

then next error output:

error c2664: 'void atl::cstringt<basetype,stringtraits>::format(const wchar_t *,...)' : cannot convert parameter 1 'const char [3]' 'const wchar_t *'

i don't understand error. help me compile code properly?

you have unicode build. seek this:

m_vsliderecho.format(_t("%d"), 0);

the error message telling format function expecting wchar_t argument (i.e. 16-bit character, means unicode) , have supplied ansi string. _t() macro prepends right modifier literal string depending on project properties.

so unicode builds, translate ;

m_vsliderecho.format(l"%d", 0);

variables mfc visual-studio-2008

No comments:

Post a Comment