Advertisement Jump to content
Sign in to follow this  

Updated from VC 8 To VC 10 and My App Has a Error in VC10 xstring Help

This topic is 1575 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



Im updateing my system and I thought why I'm at it I should get VC10 I only have vista.


Now I can build the app and it all works but when I run it I get this here does anybody know what to do here.



Share this post

Link to post
Share on other sites
Two likely causes:

1) Your code is buggy and the old version didn't catch the bug but the new version does. Use your debugger, see where the error happens, and verify the code.

2) You're linking code compiled with VC8 against code compiled with VC10. You can't do that for most code that isn't explicitly written/compiled for cross-version compatibility. Yes, this includes DLLs. You must recompile _all_ source code or acquire precompiled DLLs compatible with VC10.

Share this post

Link to post
Share on other sites

Hello, Thanks for the link(the first articles link is broken).


So vc10 port found a error. How the Hell did this bit of code run in vc8.


Heres the code what was I thinking here

//we can get the string based on the textbyte size
					std::string labeltext;
					labeltext.resize(DlgObj_Labeltemp.TextByteSize +1);//the + 1 is so we can add a null THIS HERE ??????????????

					for(DWORD textsize = 0; textsize < DlgObj_Labeltemp.TextByteSize; textsize++)
						run = FileAccess.ReadData(sizeof(char),// inbytes to read
											&labeltext[textsize]);//will hold the data read from file
						if(run == false)
						}//end error

					}//end getting text

					ValidLabel = true;

					//add a null
					//labeltext[DlgObj_Labeltemp.TextByteSize + 1] = '\0'; AND THIS HERE LOL ????????????????????

This code is out of my dialog box file loader. It loads the text for the label. How erver this run on vc8 Any Ideas.


Other then that the port was smoother then I thought it would be. Now I have another 4 apps to port fun fun fun.

Share this post

Link to post
Share on other sites

And now also get rid of that "+1" and any attempt to add useless null-bytes to a std::string.


Plus, what is the semantics of that ReadData function? One would expect the function to take the number of bytes you want to read and return the number of bytes it actually did read (not a generic bool indicating plain success). Since pretty much the only constant is that char is one byte (with no promises as to how many bits in one byte), the whole loop looks like a really convoluted way to say:



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!