Fehler bei Splashscreen
-
Habe alles laut der Suche und den Codebeispielen eingestellt, jedoch mault der immer rum, dass es keine Übereinstimmung mit
[BCC32 Fehler] UIChanger.cpp(19): E2285 Keine Übereinstimmung für 'TSplashForm::TSplashForm(void *)' gefunden
Hier mal meine Codes:
Projektdatei:
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "splash.h" //--------------------------------------------------------------------------- USERES("UIChanger.res"); USEFORM("main.cpp", mainForm); USEFORM("splash.cpp", SplashForm); //--------------------------------------------------------------------------- WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { try { Application->Initialize(); if (AnsiString(GetCommandLine()).UpperCase().Pos("/NOSPLASH")==0) { SplashForm=new TSplashForm(static_cast<void *> (NULL)); SplashForm->Show(); Application->ProcessMessages(); } SetApplicationMainFormOnTaskBar(Application, true); Application->CreateForm(__classid(TmainForm), &mainForm); Application->Run(); } catch (Exception &exception) { Application->ShowException(&exception); } catch (...) { try { throw Exception(""); } catch (Exception &exception) { Application->ShowException(&exception); } } return 0; }
SplashScreen:
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "splash.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TSplashForm *SplashForm; //--------------------------------------------------------------------------- __fastcall TSplashForm::TSplashForm(TComponent* Owner) : TForm(Owner) { } //---------------------------------------------------------------------------
Haupt-Form:
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "main.h" #include "splash.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TmainForm *mainForm; //--------------------------------------------------------------------------- __fastcall TmainForm::TmainForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TmainForm::showSplash(TObject *Sender) { Sleep(3000); if(SplashForm != NULL) { delete SplashForm; SplashForm = NULL; } } //---------------------------------------------------------------------------
Sieht da jemand den Fehler? Ich finde da keinen
-
Hi,
den Fehler hat doch der Compiler geworfen;
in deinem erstem Listing Zeile 19, ersetz die mal durchSplashForm = new TSplashForm(Application);
Wo wird denn showSplash aufgerufen ?
mfg
kpeter
-
den Code hast du ja von hier:
http://www.bytesandmore.de/rad/cpp/snipp/sc06013.phpVergleiche nochmal Zeile für Zeile die wichtigen Stellen. Ich sehe zwar momentan auch keinen Fehler, aber irgendwo scheint einer ja zu sein. Vielleicht testet du auch mal das Beispielprojekt, ob es sich übersetzen lässt.
greetz KN4CK3R