View Single Post
Old 28-11-2001, 19:38   #5
misterx
Senior Member
 
Iscritto dal: Apr 2001
Cittā: Milano
Messaggi: 3741
primo esempio mangia memoria


//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int i =0; i <FileListBox1->Items->Count; i++)
Image2->Picture->Bitmap->Handle = MyLoadPic(FileListBox1->Items->Strings[i].c_str(),false);
}
//---------------------------------------------------------------------------
HBITMAP TForm1::MyLoadPic(char *filename, bool Progressflag)
{
typedef HBITMAP (__stdcall *IMPPROC) (char *, bool);
IMPPROC ImpFunc;
HINSTANCE DllInstance;
HBITMAP ritval;

DllInstance=LoadLibrary("NViewLib.dll");
if(DllInstance != NULL){
ImpFunc =(IMPPROC) GetProcAddress(DllInstance,"NViewLibLoad");
if(ImpFunc != NULL) {
ImpFunc(filename,Progressflag);
ritval = ImpFunc(filename, Progressflag);
}
else {
ShowMessage("Funzione non trovata");
}
FreeLibrary(DllInstance);
}
else
ShowMessage("Manca la Libreria NViewLib");

return ritval;
}
//---------------------------------------------------------------------------
misterx č offline   Rispondi citando il messaggio o parte di esso