Frame öffnen
-
Hallo,
Ich möchte gerne aus einer Form heraus durch Buttonklick ein Frame in neuem Fenster geöffnet bekommen. Buttonklick etc funktioniert einwandfrei, allerdings bekomme ich immer die Fehlermeldung "EAccessViolation in VCL6xxx.bpl". Das Programm hängt dann an der Stelle. Kann mir jemand helfen? Ich arbeite mit Borland C++ 6.
Danke,
Hans
-
Wird der Frame während der Laufzeit erzeugt?
Poste am Besten ein wenig Code.
Gruss
-
Hallo,
Das Fenster sollte zur Laufzeit erzeugt werden. Ich habe mittlerweile einiges umgebaut, jetzt ist das nur noch ein Testcode. Bin ja schon froh, wenn das Fenster mal aufgeht
Also, hier ein Teil der MainForm:
TForm1 Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent Owner)
: TForm(Owner)
{
///SO oder ähnlich sollte das Fenster geöffnet werden
Form3->Show();
PageControl1->ActivePage=TabSheet1;search_query->SQL->Text = "SELECT * FROM customer ORDER BY nachname";
search_query->Open();
search_table->Open();
Kundennotizen->Text = DBCtrlGrid1->DataSource->DataSet->FieldValues["notiz"];
label_notizen->Caption = "Keine Notizen vorhanden...";
rec_count = search_query->RecordCount;
search_result->Caption = "Es sind "+IntToStr(rec_count)+" Kunden in der Datenbank:";///Andere CPP, Vom BCB generiert
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
///Hier bricht er ab Application->CreateForm(__classid(TForm3), &Form3);
Application->Run();
}
catch (Exception &exception)Die genannte FORM3 ist leer, das heisst wie vom BCB erstellt, ohne Funktionen etc. Zum Schluss noch die Includes der Main.h:
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <dbcgrids.hpp>
#include <DBTables.hpp>
#include <ComCtrls.hpp>
#include <ActnCtrls.hpp>
#include <ActnList.hpp>
#include <ActnMan.hpp>
#include <ActnMenus.hpp>
#include <Menus.hpp>
#include <StdActns.hpp>
#include <ToolWin.hpp>
#include <DBCtrls.hpp>
#include <iostream.h>
#include <DBClient.hpp>
#include <Provider.hpp>
#include <Mask.hpp>
#include <ExtCtrls.hpp>
#include <DBGrids.hpp>
#include <Grids.hpp>
#include <DBLocal.hpp>
#include <DBLocalB.hpp>
#include <DBActns.hpp>
#include "windows.h"Danke schon mal...
Hans
-
Hmmm. Dein Code sagt nicht wirklich viel aus.
Poste lieber mal den Code, in dem das Fenster/das Frame dynamisch erzeugt wird. Also Deine Button(?)-Ereignisbehandlungsroutine.