> IN ADDITION:
"
// Creates and initializes several BitArrays.
BitArray* myBA1 = new BitArray( 5 );
"
(quote from the IDE sample code)
DOES NOT COMPILE. You get some arcane worthless message that is not at
all
helpful. Also:
BitArray* myBA1;
myBA1 = new BitArray( 5 );
fails with the same error.
This compiles:
BitArray* myBA1;
myBA1->set_Length( 5);
but will SURELY fail at runtime...or will it?...as no memory was ever
allocated...or was it?!
WTF?
Ok, lets start at the beginning. In your first post you said you were
building OS dlls. I assume you are working on a personal OS. In which case
the CLR and the BitArray class are not ideal, since that is linked to the
CLR and I imagine implementing the whole of the CLR isn't high on your wish
list(that potentially means a huge number of classes, including BItArray,
along with a JIT, a GC, and so on. The Mono project might help, but thats
still alot of work). You'd do better to use pure C++ templates such as those
available in the boost project(
www.boost.org,) assuming they fit your
licensing requirements.
Second, what version of Visual Studio(or Visual C++) are you using? There
are two different C++ dialects for managed code, MC++(or Managed Extensions
for C++) which has been available since VS2002(IIRC) and CLI/C++ which
debuted with VS2005. Both work different than standard C++ when working with
managed classes and will require a little learning to use properly. MC++
especially is a little tricky.