Thread View: de.comp.lang.c++
2 messages
2 total messages
Started by Christoph Franzen
Mon, 23 Oct 1995 20:34
allg. Schutzverletzung Teil II
Author: Christoph Franzen
Date: Mon, 23 Oct 1995 20:34
Date: Mon, 23 Oct 1995 20:34
166 lines
4139 bytes
4139 bytes
Christoph Franzen Duisburg, den Mo 23.10.1995
Hallo ,
ich habe mit dem Compiler noch ein wenig rumgespielt und
ein paar Schalter gesetzt. Hierdurch bekomme ich jetzt
eine etwas genauere Fehlermeldung. Sie lautet:
allgemeine Schutzverletzung in OWL250.DLL an Adresse 003B:105C
Ich habe den Source-Code von allen nicht unbedingt notwendigen
Sachen befreit und muß feststellen, der Rechner stürzt dennoch
ab. Der Code sieht so aus:
Adress.cpp
#include <owl\applicat.h>
#include <owl\dialog.h>
#include <owl\edit.h>
#include <owl\framewin.h>
#include <cstring.h>
#include <stdio.h>
#include <string.h>
#pragma hdrstop
#include "adress.rc"
// Klasse für das Adressfenster
//
class TAdress : public TDialog
{
public:
TAdress(TWindow* parent, TResId resid);
};
// Clientfenster
//
class Client: public TWindow
{
public:
Client(TWindow* parent=0);
protected:
void CmSuchen();
private:
DECLARE_RESPONSE_TABLE(Client);
};
DEFINE_RESPONSE_TABLE1(Client,TWindow)
EV_COMMAND(CM_ADR_SUCHEN,CmSuchen),
END_RESPONSE_TABLE;
TAdress::TAdress(TWindow* parent,TResId resid):TDialog(parent,resid)
{
new TEdit(this, IDC_NAME, 50);
new TEdit(this, IDC_STRASSE,50);
new TEdit(this, IDC_ORT,50);
new TEdit(this, IDC_TEL,40);
new TEdit(this, IDC_FAX,40);
}
Client::Client(TWindow* parent) : TWindow(parent)
{
; //
}
void Client::CmSuchen()
{
long gad=0;
do
gad=TAdress(this,DIALOG_1).Execute();
while(gad==IDC_DELETE); // Gadget löschen, sonst weiter
}
// Ableitung der Anleitung
//
class AdressApp : public TApplication
{
public:
AdressApp(): TApplication()
{
nCmdShow=SW_SHOWMAXIMIZED;
}
void InitMainWindow()
{
SetMainWindow(new TFrameWindow(0,"Adressen:",new Client));
GetMainWindow()->AssignMenu("SYS_MENU");
}
};
// Programmstart
//
int OwlMain(int, char*[])
{
return AdressApp().Run();
}
und Adress.rc sieht so aus:
/*
ADRESS.RC
produced by Borland Resource Workshop
*/
#define CM_NEUE_ADRESSE 113
#define CM_ADR_SUCHEN 112
#define CM_ADR_OPEN 111
#define DIALOG_1 1
#define IDC_STRASSE 102
#define IDC_ORT 103
#define IDC_TEL 104
#define IDC_FAX 105
#define IDC_DELETE 106
#define IDC_WEITER 107
#define IDC_DRUCKEN 108
#define IDC_NAME 101
#define IDOK 1
#ifdef RC_INVOKED
DIALOG_1 DIALOG 30, 15, 222, 121
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Adresse 19.10.95 (c) by Christoph Franzen"
FONT 10, "System"
{
DEFPUSHBUTTON "OK", IDOK, 150, 6, 50, 14
PUSHBUTTON "Abbruch", IDCANCEL, 150, 24, 50, 14
LTEXT "Name", -1, 3, 10, 30, 12
LTEXT "Straße", -1, 3, 25, 30, 12
LTEXT "Ort", -1, 3, 40, 30, 12
LTEXT "Tel.", -1, 3, 55, 30, 12
LTEXT "Fax", -1, 3, 70, 30, 12
EDITTEXT IDC_NAME, 35, 10, 100, 12
EDITTEXT IDC_STRASSE, 35, 25, 100, 12
EDITTEXT IDC_ORT, 35, 40, 100, 12
EDITTEXT IDC_TEL, 35, 55, 100, 12
EDITTEXT IDC_FAX, 35, 70, 100, 12
PUSHBUTTON "Löschen", IDC_DELETE, 150, 78, 50, 14
PUSHBUTTON "Weiter", IDC_WEITER, 150, 95, 50, 14
CONTROL "", -1, "BorShade", BSS_RGROUP | BSS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 1, 5, 135, 85
PUSHBUTTON "Drucken", IDC_DRUCKEN, 150, 60, 50, 14
}
SYS_MENU MENU
{
POPUP "&Datei"
{
MENUITEM "Adressdatei &öffnen", CM_ADR_OPEN
MENUITEM "&Suchen", CM_ADR_SUCHEN
MENUITEM "&Neue Adresse", CM_NEUE_ADRESSE
}
}
#endif
Ich wünsche einen schönen Tag.
Christoph Franzen
Re: allg. Schutzverletzung Teil II
Author: Christoph Franzen
Date: Wed, 25 Oct 1995 10:16
Date: Wed, 25 Oct 1995 10:16
37 lines
1439 bytes
1439 bytes
Hallo,
zuersteinmal vielen Dank für die Hilfe. Mein Programm
funktioniert jetzt.
Ich habe in
class AdressApp : public TApplication
{
public:
AdressApp(): TApplication()
{
nCmdShow=SW_SHOWMAXIMIZED;
-----> EnableBWCC(TRUE); <------- eingefügt
}
void InitMainWindow()
{
SetMainWindow(new TFrameWindow(0,"Adressen:",new Client));
GetMainWindow()->AssignMenu("SYS_MENU");
}
};
die Zeile EnableBWCC eingefügt (Dank an ....fht-mannheim.de (Junk),
der mir den Tip gab).
Ich habe daraufhin mal in meinem OWL-Buch (Borland C++ 4.5 vom M&T)
nachgesehen. In dem Buch kommt diese Funktion nicht vor. Ob das
ein Fehler im Buch ist, oder ob es einen Compilerschalter gibt,
der die Funktion überflüssig macht, weiß ich nicht.
Ich wünsche einen schönen Tag.
Christoph Franzen
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads