Inconsistent errors - MSVC++ 6
Okay, here's the pronlem:
I have some image editing code, that totals up to 15 different functions. All of these functions use a class called rgb. Class rgb has the following members:
r
g
b
s
Now, for some reason, sometimes when I try to use an rgb class, I can't access these variables, despite the fact that they're public for simplicity. Here's a declaration of a function that can access them:
Code:
AndMaps( rgb src[], rgb trgt[], long pixels )
And here's an example of one that can't use the members:
Code:
TraMaps( rgb src[], rgb Faded, double fade, long pixels )
Now, I can't see any differences between these that should cause problems. However, just to be safe, here's the error messages:
Quote:
--------------------Configuration: Image Operations 2 - Win32 Debug--------------------
Compiling...
RGB_Operations.cpp
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(129) : error C2228: left of '.b' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(130) : error C2228: left of '.g' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(131) : error C2228: left of '.r' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(145) : warning C4804: '<' : unsafe use of type 'bool' in operation
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(145) : warning C4804: '<' : unsafe use of type 'bool' in operation
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(145) : error C2228: left of '.r' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(147) : error C2228: left of '.b' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(149) : warning C4804: '>' : unsafe use of type 'bool' in operation
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(149) : warning C4804: '>' : unsafe use of type 'bool' in operation
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(149) : error C2228: left of '.r' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(151) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class rgb' (or there is no acceptable conv
ersion)
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(165) : error C2676: binary '!=' : 'class rgb' does not define this operator or a conversion to a type acceptable to the predefined operat
or
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(232) : error C2676: binary '[' : 'class rgb' does not define this operator or a conversion to a type acceptable to the predefined operato
r
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(232) : error C2228: left of '.b' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(233) : error C2676: binary '[' : 'class rgb' does not define this operator or a conversion to a type acceptable to the predefined operato
r
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(233) : error C2228: left of '.g' must have class/struct/union type
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(234) : error C2676: binary '[' : 'class rgb' does not define this operator or a conversion to a type acceptable to the predefined operato
r
C:\Documents and Settings\Owner\My Documents\My Files\Programming\C++\BMP Actions\BMP Editor\RGB_Operations.cpp(234) : error C2228: left of '.r' must have class/struct/union type
Error executing cl.exe.
RGB_Operations.obj - 14 error(s), 4 warning(s)
I realize that some of the stuff I'll need to deal with anyways, like the = and -= operators, but I decided to give you the entire message. So, can you guys tell me what to do? I'm kinda stuck here.