Hi everyone,

Please bear with me this is my first post here at daniweb. I usually develop in C or assembly for embedded systems, but occasionally I have need to develop a PC application using C/C++ and have relied on Visual Studio C++ 6.0.

Unfortunately I recently purchased a laptop with Vista, so VSC++ 6 is a no go. I was left with the choice of down grading to XP, or upgrade to Visual studio enterprise.

I like vista so I choose the second path, and I like the new look. The problem I have is that enterprise converts the VSC++ 6 projects to enterprise, but then the code fails to build!!

The warnings I expected, because I use mostly win32 libraries which are supported, but not encouraged, however I now have errors in code that compiled in VSC++ 6.


Very strange. I use the 'conversion thing' quite often and never had problems with it. (from 6.0 to 2005 and from 6.0 to 2008)

Could you post a few errors?

>have relied on Visual Studio C++ 6.0
I'm sorry. I once relied on Visual Studio 6.0 too, and I'm thankful that there are better versions now.

>but then the code fails to build!!
What a shocker. Speaking of compatibility, did you know that my old installation of Visual Studio 6.0 made extensive use of custom preprocessors and my own complete version of the standard C and C++ libraries so that it would conform to the standards?

>I now have errors in code that compiled in VSC++ 6.
That's to be expected, but I can't really help if you don't tell us what the errors are, or point out the code that caused them.

One very common problem I had with porting from 6.0 was the use of loop counters, for example:

for(int i = 0; i < something; i++)
   // do something

if( i == 0 ) // ok on VC++ 6.0 but not in C++ standards or VC++ 2005/8/9

MFC has a ton of incompatabilities because may of its classes were converted to use templates.

How to correct: Take the errors one as a time and make them conform to the requirements of your current compiler and c++ standard. There is no quick fix -- just fix them one at a time.

Sorry wasn't thinking

Here is the error statement

": error C2679: binary '!=' : no operator found which takes a right-hand operand of type 'std::_Vector_iterator<_Ty,_Alloc>' (or there is no acceptable conversion)"

and the code segment it refers to

unsigned char MemoryBlock::operator [] (unsigned int address)
	for (MemorySlice *i = begin(); i != end(); i++)
		if (i->in(address))
			return (*i)[address];

	return emptyFillM;

As a sanity check I just compiled the code on my desktop, without errors, and then copied the same project to the laptop and it generated the above error.


what is MemorySlice ? An iterator? And what does begin() and end() return?

[deleted] sorry for the trouble

MemorySlice is a string item in a linked list

begin returns an iterator addressing the first element in the string,

while end returns an iterator that addresses the location succeeding the last element in a string.

The application reads an intel formatted file, each line is decoded and written to a memory slice. All the memory slices constitute a block of memory representing the virtual address space of an embedded processor.

I think my problem stems from the standard template used for basic_string which forms the basis for the MemorySlice class.

Don't you need an iterator for that loop

string MemorySlice;
    for( string::iterator i = MemorySlice.begin(); i != MemorySlice.end(); i++)

No an iterator doesn't help, but it does give me an idea the definition for a string template must have changed in the many revisions to the C++ compiler. I need to analyze the structure and relationships of the Memory Slice object.

I'll try to get my conclusions out by next week

Thanks for the ideas


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.