468,513 Members | 941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

VS 2005 atlbase.h Compilation Error

Hi,

I have a VS 6 project and I am trying to compile it using VS 2005.
My program has the atlbase.h include which seems to trigger the errors.
It used to compile OK using VS 6.

The include path is:
C:/Program Files/Microsoft Visual Studio 8/VC/include;C:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/include;C:/Program Files/Microsof
t Visual Studio 8/SDK/v2.0/include;C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/include; ... and other stuff

Here are the error messages:

c:\program files\microsoft visual studio 8\vc\atlmfc\include\statreg.h(1106) : error C2664: 'ATL::Checked::tcsncpy_s' : cannot convert param
eter 2 from 'TCHAR [32]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\statreg.h(1370) : error C2664: 'ATL::Checked::tcsncpy_s' : cannot convert param
eter 2 from 'TCHAR [260]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(5891) : error C2664: 'void ATL::CAtlModule::EscapeSingleQuote(LPOLEST
R,size_t,LPCOLESTR) throw()' : cannot convert parameter 2 from 'OLECHAR [520]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(5974) : error C2664: 'void ATL::CAtlModule::EscapeSingleQuote(LPOLEST
R,size_t,LPCOLESTR) throw()' : cannot convert parameter 2 from 'OLECHAR [520]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6433) : error C2664: 'ATL::Checked::strcpy_s' : cannot convert parame
ter 2 from 'TCHAR *' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6452) : error C2664: 'ATL::Checked::strcpy_s' : cannot convert parame
ter 2 from 'TCHAR *' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6674) : error C2664: 'ATL::Checked::strcpy_s' : cannot convert parame
ter 2 from 'TCHAR [128]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6675) : error C2664: 'ATL::Checked::strcat_s' : cannot convert parame
ter 2 from 'TCHAR [128]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6676) : error C2664: 'ATL::Checked::strcat_s' : cannot convert parame
ter 2 from 'TCHAR [128]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6699) : error C2664: 'ATL::Checked::strcpy_s' : cannot convert parame
ter 2 from 'TCHAR [128]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6700) : error C2664: 'ATL::Checked::strcat_s' : cannot convert parame
ter 2 from 'TCHAR [128]' to 'size_t'
There is no context in which this conversion is possible
c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlbase.h(6701) : error C2664: 'ATL::Checked::strcat_s' : cannot convert parame
ter 2 from 'TCHAR [128]' to 'size_t'
There is no context in which this conversion is possible
make: *** [win32/Debug/ProParser.o] Error 2

Thanks for any hep.

Misu
Nov 27 '07 #1
1 4785
weaknessforcats
9,207 Expert Mod 8TB
c:\program files\microsoft visual studio 8\vc\atlmfc\include\statreg.h(1106) : error C2664: 'ATL::Checked::tcsncpy_s' : cannot convert param
eter 2 from 'TCHAR [32]' to 'size_t'
For openers, tcsncpy_s has a second argument that is a size_t for the number of elements to copy. You are apprarently using the address of a TCHAR array in that position.

Check the function prototypes the functions in MSDN.

You need to fix the code.
Nov 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Mythran | last post: by
9 posts views Thread by subramanian | last post: by
2 posts views Thread by subramanian | last post: by
9 posts views Thread by subramanian100in | last post: by
2 posts views Thread by subramanian100in | last post: by
3 posts views Thread by subramanian100in | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.