Click here to Skip to main content
15,884,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to compile the code originally written in Visual studio 6 to VS 10. I read in one of the MSDN article that 'atlmfc' has been removed from VS10. what is the alternative for atlmfc in VS10 ? error is pointing to atlchecked.h file. for example :

error C2664: 'AfxCrtErrorCheck' : cannot convert parameter 1 from 'char *' to 'errno_t' 1> There is no context in wich this conversion is possible . ....
program files (x86)\microsoft visual studio 10.0vc\atlmfc\include\atlcomcli.h(2235): error C2065: 'cVal' : undeclared identifier

ETC..

These errors are in all the header files like atlcomcli.h, oaidl.h.
part 1) I guess that whatever is included in #ifdef has not been recognized in VS10, I might need to give correct path or include relevant header file. Surprisingly no solution on the net so far. If I compare with other solution it doesnt seem to be a problem since path is correct. I am picking all the atlmfc files from visual studio 10 version.
part 2) I think code change is required but here the problem it points to is pre processor code given below.
#ifdef _AFX
#define ATLMFC_CRT_ERRORCHECK(expr) AFX_CRT_ERRORCHECK(expr)
#else #define ATLMFC_CRT_ERRORCHECK(expr) ATL_CRT_ERRORCHECK(expr)
#endif

Part 3) One of the article on the net says - http://msdn.microsoft.com/en-us/library/bb531344.aspx

"#ifdefs in the MFC header files are removed." What does that mean ? if that is removed any alternative for that in Visual studio 10 ? I do have a paid version of visual studio 10.

Also can i directly convert VS6 code to VS10 or should i convert it to VS8 first and then migrate it to VS10 ? I know some code changes will be required but Since I am not able to compile I am unable to debug and reach a place where a loop or condition is breaking. I just want my code to compile for now. I do have paid version of VS10.

Pls help.
Posted
Updated 20-Jul-14 22:07pm
v2
Comments
Richard MacCutchan 21-Jul-14 4:29am    
Your code should compile in VS 10, although you will need to make some corrections where things have changed. You just need to go through each compiler error and correct your code to match the new definitions.
Swap9 21-Jul-14 5:19am    
Right, my compiler error says
c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlchecked.h(138): error C2664: AfxCrtErrorCheck' : cannot convert parameter 1 from 'char *' to 'errno_t'
1> There is no context in which this conversion is possible
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlchecked.h(190): error C2664: 'AfxCrtErrorCheck' : cannot convert parameter 1 from 'char *' to 'errno_t'
1> There is no context in which this conversion is possible
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlchecked.h(218): error C2664: 'AfxCrtErrorCheck' : cannot convert parameter 1 from 'char *' to 'errno_t'


1> There is no context in which this conversion is possible
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(549): error C2039: 'vt' : is not a member of 'tagVARIANT'
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\oaidl.h(427) : see declaration of 'tagVARIANT'

Where do I go for that ? Where are the new definations ?
Richard MacCutchan 21-Jul-14 12:18pm    
It sounds like you have some values set wrongly somewhere. The only way to narrow this down is to look at the actual lines of code where the errors are, to see exactly what is being complained about, and work backwards to find where they are mis-defined. Alternatively, check that your own source code does not contain any strange definitions which conflict with the library files.
RedDk 17-Feb-15 13:37pm    
Have you tried using /FORCE? Located in the Linker options (haven't got VS here in front of me so where exactly is conjecture on my part). This'll give you a better purchase on DEBUG. Go line by line from there.
Sergey Alexandrovich Kryukov 17-Feb-15 16:21pm    
Use the FORCE, Luke... :-)
—SA

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