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

Started by
4 comments, last by Trienco 9 years, 7 months ago

Hi.

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.

VC10ERROR.jpg?psid=1

Advertisement
Start with this.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

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.

Sean Middleditch – Game Systems Engineer – Join my team!

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)
						{
							break;
						}//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.

Expect even more fun if you use custom allocators with STL, the allocator interface for STL changed with VC10.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

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:

FileAccess.ReadData(labeltext.size(), &labeltext[0]);

f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement