> All code is available at http://sourceforge.net/svn/?group_id=14171
Thank you Olaf! Compiling this code in BCB works, but I get an access violation error (at runtime) from the decode80c function:
TMemoryStream *ms = new TMemoryStream();
TMemoryStream *map = new TMemoryStream();
IdDecoderMIME1->DecodeToStream(Memo1->Text, ms); // decode base64 text
ms->Position = 0;
int chunk_length;
int *chunk_length_p = &chunk_length;
// Chunk 1
ms->Read(chunk_length_p, 3);
ms->Seek(1, soFromCurrent);
PChar chunk;
PChar *chunk_p = &chunk;
PChar chunk_out;
ms->Read(chunk_p, chunk_length);
/* here comes the access violation error in decode80c at line "code = *readp++;" */
decode80c(chunk, chunk_out, chunk_length);
map->Write(chunk_out, chunk_length);
// Chunk 2...
// Chunk 3...
// Chunk 4...
// Chunk 5...
// Chunk 6...
map->SaveToFile("C:\\map.dat");
delete map;
delete ms;