Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi all,
As microsoft provide new version of studio.i deciced to moved my window based application from visual studio 2003 to visual studio 2010.

a great Techanology aspected more use full control from 2010 compare to 2003.

Fine,
but one problem arise when convert my window based program from 2003 to 2010,
2010 version of studio gives following errors that not given in 2003.
C++
for(int i = 0;i<10;i++)
{
    ......
}

Undeclared identifier "i"

now same problem solved when im try like,
C++
int i;
for(i = 0;i;<10;i++)
{
    ......
}


if i go with above techanique that tends to replace my all for loops.
that may take my 7 or 8 days.
So there are two aternative.
GOOGLE
and
Experts.

After spending my whole day on google doen't found any think useful.
So need expert.

Please ,
Provide me even single hint that convert my whole visual studio 2003 project to 2010 without an single error.


Thanks.
santosh dhanawade.
Posted

1 solution

You may change your project settings. See /Zc:forScope (Force Conformance in for Loop Scope)[^].

The option can be also changed in the source files using the conform pragma[^].
 
Share this answer
 
Comments
Coder Block 4-Sep-12 4:17am    
thank u so much,
but when i compilee the application it throws errors as follows
pscrollbarinfo class error....
ccm_setwindowtheme not found ...
etc.
but when i define winver and winnt to 0x0500 then
all above errors are solved with new link error ie
error LNK1104:cannot open file mfc71d.lib......
please reply soon....
Jochen Arndt 4-Sep-12 4:44am    
CCM_SETWINDOWTHEME requires Windows XP or later and is only defined when _WIN32_WINNT >= 0x0501 (see commctrl.h). But this has not changed compared to VS 2003.

mfc71d.lib is the static debug library of VS 2003. If you get this error, the library is referenced by your linker project settings (direct or via added object or library files).

You may open the .vcproj file of your project with a text editor to check if mfc71d.lib is part of the project. By default the MFC library names are not part of the project settings.

If your project uses other object files or libraries, these must be also rebuild using VS 2010.
Coder Block 5-Sep-12 1:34am    
Now a new problem arised ,
Complilar not accepting AfxMessageBox("HELLO");

gives error cannot convert CString to LPCTSTR..
Jochen Arndt 5-Sep-12 2:58am    
I did not see a CString object. However, constant strings should be passed using the _T() macro to be prepared for Unicode and ANSI builds: AfxMessageBox(_T("Hello")).
But this was also recommended with VS 2003.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900