C++ Builder 6 mam problem, nie wiem dlaczego, ale podczas uruchamiania aplikacji pojawia się okno błedu.
( debugger exception notification
Project Project1.exe raised exception class EAccessViolation with message 'Access violation 00448926 in module 'Project1.exe'. Read of address 0000002EC'. Process stopped. Use Step or Run to continue.)
zaś mój kod wygląda tak:
(Unit5.cpp)
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit5.h"
//
#include "Unit6.h"
#include "Unit4.h"
#include "Unit3.h"
#include "Unit2.h"
#include "Unit1.h"
#include <fstream.h>//txt
//
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tinfo *info;
//---------------------------------------------------------------------------
__fastcall Tinfo::Tinfo(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tinfo::wwwClick(TObject *Sender)
{
ShellExecute( NULL, "open", "http://haslo.5v.pl/", "", "", SW_SHOWNORMAL );
}
//---------------------------------------------------------------------------
void __fastcall Tinfo::FormCreate(TObject *Sender)
{
Sleep(1000);
Startup->Visible = false;
ifstream infile;
infile.open("txt/hasło.txt", ios::in);
if(!infile)
{
ShowMessage("Otwarcie pliku nie powiodło się.");
Log->Visible = true;
NoweKont->Visible = false;
}
else
{
ShowMessage("Otwarcie pliku powiodło się.");
Log->Visible = false;
NoweKont->Visible = true;
}
infile.close();
}
//---------------------------------------------------------------------------
(Project1.cpp)
/---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", NoweKont);
USEFORM("Unit2.cpp", Log);
USEFORM("Unit3.cpp", zmianaH);
USEFORM("Unit5.cpp", info);
USEFORM("Unit6.cpp", Startup);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(Tinfo), &info);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------
Proszę o pomoc.
Niem wiem gdzie mam bład.
Z góry dziękuje