Message-ID: <33F9EFDA.31CC@nf.sympatico.ca> Date: Tue, 19 Aug 1997 16:41:22 -0230 From: Colin Walsh Reply-To: cwalsh AT nf DOT sympatico DOT ca Organization: Colossal Software MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp CC: djgpp AT delorie DOT com Subject: Re: Creating Class Libraries References: <33F9EE76 DOT 7A91 AT nf DOT sympatico DOT ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Oops, forgot to put it on the Mailing list.... I have tried recently to create libraries supporting all of the filetypes that I keep creating for my various projects, but a problem has come up. I want the libs to use classes, but they wont compile properly. Here is the source that loads .CGR (Colossal GRaphics) #include #include #include class cgrfile{ protected: unsigned char *cgrdata; long w,h; public: cgrfile() { cgrdata=(unsigned char *)malloc(0); w=0; h=0; } void cgrload(char *filename,int palswitch) { unsigned char bit; unsigned char RGB[3]; fstream cgr(filename,ios::in|ios::binary); cgr.read((char *)&w,sizeof(long)); cgr.read((char *)&h,sizeof(long)); cgrdata=(unsigned char *)realloc((void *)cgrdata,w*h); if(palswitch==0)//dont load the palette { for(int x=0;x<256;x++) { cgr.read(RGB,3); } } if(palswitch==1)//load the palette { for(int x=0;x<256;x++) { cgr.read(RGB,3); GrSetColor(x,RGB[0],RGB[1],RGB[2]); } } for(long x=0;x