hi guys,
im currently creating a steganography demo in borland builder 6.0 (yes i know it sucks but its what ive been asked to use lol)
i jsut created a random class with which ill include some functions for my program. in my class header file i haev declared an ImageList as TStringList* ImageList, however it is pulling up an expected type name error. ive searched through my code and im sure i have included the header and the cpp file correctly into the project.
here is my main code so far, followed by the class and its header:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <jpeg.hpp>
#include "C_Random.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFmSlideShow *FmSlideShow;
C_Random Random;
//---------------------------------------------------------------------------
__fastcall TFmSlideShow::TFmSlideShow(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFmSlideShow::sbtnOpenClick(TObject *Sender)
{
if (!OpenImageDIR->Execute()) return;
AnsiString Dir = ExtractFileDir(OpenImageDIR->FileName); // get the Dir
AnsiString Ext = ExtractFileExt(OpenImageDIR->FileName); // get the Ext
Random.GetFileNames(Ext, Dir, Memo1, OpenImageDIR);
//StatusBar1.Panels[0]->Text = "what";
}
//---------------------------------------------------------------------------
void __fastcall TFmSlideShow::sbtnStretchClick(TObject *Sender)
{
Image1->Stretch = !Image1->Stretch;
}
//---------------------------------------------------------------------------
void __fastcall TFmSlideShow::sbtnProportionalClick(TObject *Sender)
{
Image1->Proportional = !Image1->Proportional;
}
//---------------------------------------------------------------------------
void __fastcall TFmSlideShow::sbtnQuitClick(TObject *Sender)
{
FmSlideShow->Close();
}
//---------------------------------------------------------------------------
header and class:
#ifndef C_Random_H
#define C_Random_H
#include "C_Random.h"
class C_Random
{
public:
int GetFileNames(AnsiString Ext, AnsiString Dir, TMemo* Memo1, TOpenDialog* OpenImageDIR, bool Random = true);
void CreateList();
TSringList* ImageFiles;
private:
};
#endif
#include "C_Random.h"
#include <iostream.h>
#include <cstdlib.h>
void C_Random::CreateList()
{
ImageFiles = new(TStringList);
}
int C_Random::GetFileNames(AnsiString Ext, AnsiString Dir, TMemo* Memo1, TOpenDialog* OpenImageDIR, bool Random);
{
CreateList();
// Collect all files of the same type
TSearchRec SearchRec;
int iAttributes = faAnyFile; // Read only etc
// provide FindFirst with Dir and filename example
if (FindFirst(Dir+"\\*"+Ext, iAttributes, SearchRec) == 0)
{
Memo1->Lines->Add(Dir+"\\"+SearchRec.Name);
// add first picture to the main image
Image1->Picture->LoadFromFile(OpenImageDIR->FileName);
//StatusBar.Panels[0]->Text = (Dir+"\\"+SearchRec.Name);
while (FindNext(SearchRec) == 0)
{
Memo1->Lines->Add(Dir+"\\"+SearchRec.Name);
}
}
else
ShowMessage("Directory search failed!");
FindClose(SearchRec);
}
any help on spotting why this error, will be muchO help
15Peter20