MDI Form ve Şifre Formu Sorunu (ÇÖZÜLDÜ)

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
boncapelo
Üye
Mesajlar: 49
Kayıt: 01 Tem 2005 02:28
Konum: Bursa
İletişim:

MDI Form ve Şifre Formu Sorunu (ÇÖZÜLDÜ)

Mesaj gönderen boncapelo »

)Selamun Aleykum...
Öncelikle herkese kolay gelsin benim sorunum şu forumda yeterince aradım ve sonuçlarda çıktı fakat söylenenlerin heosini yapmama rağmen sorun ve hatalar devam ediyor...
yaoı şu şekilde.anafrm adında mdi form olan main formum var.birtane splashform ve sifrefrm adında üç form.program ilk create edilirken splash formu açıyorum ardından mdi ana form açılıyor ve splash form close ediliyor forumda okudum anafrm açılırken şifre formunu showmodal yapın demişler yapıyorum fakat hata veriyor hata access violation hatası inanın o kadar çok şey denedimki hatırlamıyorum bile çoğunu.lütfen bi çözüm yolu varsa yardımcı olun...
Allah Razı Olsun...
En son boncapelo tarafından 05 Nis 2008 09:16 tarihinde düzenlendi, toplamda 1 kere düzenlendi.
..::ÖzSoft Computer Land & NetCity Internet Cafe::..
Kullanıcı avatarı
odemir01
Üye
Mesajlar: 31
Kayıt: 01 Eki 2007 10:37
Konum: Adana

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen odemir01 »

algoritma olarakdoğru yapmıssın. ama istersen bi kodları gonder. hatanın nerede olduğuna bakıp düzeltelim
Varsa Yoksa Delphi
boncapelo
Üye
Mesajlar: 49
Kayıt: 01 Tem 2005 02:28
Konum: Bursa
İletişim:

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen boncapelo »

Selamun Aleykum.
Cevap için teşekkürler.Access Violation hatası mdi anafrm nin onshowuna yazınca veriyor...ama istersen bu üç formun kodlarını gönderebilirim...
..::ÖzSoft Computer Land & NetCity Internet Cafe::..
Kullanıcı avatarı
unicorn64
Üye
Mesajlar: 919
Kayıt: 04 Nis 2006 08:56
Konum: yine yeniden Ankara ^_^

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen unicorn64 »

access violation oluşturulmayan nesneye, dizilerde olmayan indise, kısaca hafızada olmayan yere ulaşmaya çalışınca alınan bir hata.
ama müneccim olmadığımıza göre, forumun sihirli küresi de bu ara pek net göstermediğinden siz en iyisi kodları bi gönderin...
bazen yükselmek için önce dibi görmek gerekir...

forumda soru sormadan önce bakılmalı bence
daha fazlası için...

yürümeyi öğrenmeden koşmaya çalışanlar için, tökezleyip düşmek kaçınılmazdır...

Resim
Kullanıcı avatarı
Battosai
Üye
Mesajlar: 1316
Kayıt: 01 Eki 2007 12:02
Konum: Ankara

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen Battosai »

Şifre formu mdichild ise...TFormX.create() şeklinde oluşturup göstermeniz lazım gelir...kullanım örnekleri forumda mevcut...ayrıca kodları görmeden zaten bişey diyemeyiz...
boncapelo
Üye
Mesajlar: 49
Kayıt: 01 Tem 2005 02:28
Konum: Bursa
İletişim:

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen boncapelo »

Selamun Aleyküm.
Cevaplar için allah razı olsun.
sifrefmr ve splash frm ikisde mdi child değil normal form.ama mdi child de denedim show dan önce create ettirdim.ama yine olmaı bu haliyle kodları gönderim...

anafrm;

Kod: Tümünü seç

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, RzButton, ExtCtrls, RzPanel, RzPathBar, RzPopups, RzGroupBar,
  cxControls, cxContainer, cxEdit, cxImage, dxGDIPlusClasses, ppDB, ppDBPipe,
  ppParameter, ppVar, ppBands, ppCtrls, ppPrnabl, ppClass, ppCache, ppComm,
  ppRelatv, ppProd, ppReport;

type
  Tanafrm = class(TForm)
    RzPathBar1: TRzPathBar;
    islemlerbut: TRzMenuButton;
    raporlarbut: TRzMenuButton;
    ayarlarbut: TRzMenuButton;
    RzMenuButton1: TRzMenuButton;
    MainMenu1: TMainMenu;
    Program1: TMenuItem;
    Ayarlar1: TMenuItem;
    Hakknda1: TMenuItem;
    kartlarmenu: TPopupMenu;
    Cariakrtlar1: TMenuItem;
    StokKartlar1: TMenuItem;
    islemlermenu: TPopupMenu;
    raporlarmenu: TPopupMenu;
    Mal1: TMenuItem;
    MalSat1: TMenuItem;
    deme1: TMenuItem;
    PerakendeSat1: TMenuItem;
    StokRaparu1: TMenuItem;
    CariRaporu1: TMenuItem;
    MalAlmRaporu1: TMenuItem;
    MalSatmRaporu1: TMenuItem;
    demeRaporu1: TMenuItem;
    ahsilatRaporu1: TMenuItem;
    zelRaporlar1: TMenuItem;
    EnokSatlanrnler1: TMenuItem;
    Azalanrnler1: TMenuItem;
    EnokAlVeriYapan1: TMenuItem;
    RzGroupBar1: TRzGroupBar;
    RzGroup1: TRzGroup;
    RzGroup2: TRzGroup;
    Image1: TImage;
    Filer1: TMenuItem;
    tarih: TRzCalendar;
    N1: TMenuItem;
    procedure StokKartlar1Click(Sender: TObject);
    procedure Cariakrtlar1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure RzGroup1Items0Click(Sender: TObject);
    procedure RzGroup1Items1Click(Sender: TObject);
    procedure PerakendeSat1Click(Sender: TObject);
    procedure StokRaparu1Click(Sender: TObject);
    procedure zelRaporlar1Click(Sender: TObject);
    procedure RzGroup1Items2Click(Sender: TObject);
    procedure RzGroup1Items3Click(Sender: TObject);
    procedure RzGroup1Items4Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  anafrm: Tanafrm;

implementation

uses Unit2, Unit4, Unit3, Unit5, Unit6, Unit7, Unit10, Unit11, Unit8, Unit12,
  Unit9;

{$R *.dfm}

procedure Tanafrm.Cariakrtlar1Click(Sender: TObject);
begin
if not assigned(carifrm) then
application.CreateForm(tcarifrm,carifrm);
end;

procedure Tanafrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
end;

procedure Tanafrm.FormShow(Sender: TObject);
begin
tarih.Date:=date;
sifrefrm.ShowModal;
end;

procedure Tanafrm.PerakendeSat1Click(Sender: TObject);
begin
if not assigned (psatisfrm) then
application.CreateForm(tpsatisfrm,psatisfrm);
end;

procedure Tanafrm.RzGroup1Items0Click(Sender: TObject);
begin
if not assigned (stokeklefrm) then
application.CreateForm(tstokeklefrm,stokeklefrm);

end;

procedure Tanafrm.RzGroup1Items1Click(Sender: TObject);
begin
if not assigned (carieklefrm) then
application.createform(tcarieklefrm,carieklefrm);
end;

procedure Tanafrm.RzGroup1Items2Click(Sender: TObject);
begin
if not assigned (psatisfrm) then
application.CreateForm(tpsatisfrm,psatisfrm);
end;

procedure Tanafrm.RzGroup1Items3Click(Sender: TObject);
begin
verisayfasi.ppReport1.Print;
end;

procedure Tanafrm.RzGroup1Items4Click(Sender: TObject);
begin
if not assigned(satisrfrm) then
application.CreateForm(tsatisrfrm,satisrfrm);
end;

procedure Tanafrm.StokKartlar1Click(Sender: TObject);
begin
if not assigned(stokfrm) then
application.CreateForm(tstokfrm,stokfrm);
end;

procedure Tanafrm.StokRaparu1Click(Sender: TObject);
begin
verisayfasi.ppReport1.Print;
end;

procedure Tanafrm.zelRaporlar1Click(Sender: TObject);
begin
if not assigned(satisrfrm) then
application.CreateForm(tsatisrfrm,satisrfrm);
end;

end.
sifrefrm;

Kod: Tümünü seç

unit Unit12;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, cxLookAndFeelPainters, Buttons, StdCtrls, cxCheckBox,
  cxButtons, cxTextEdit, cxControls, cxContainer, cxEdit, cxLabel, ExtCtrls,
  JvExExtCtrls, JvNavigationPane, dxGDIPlusClasses, RzPanel, RzSplit;

type
  Tsifrefrm = class(TForm)
    JvNavPanelDivider1: TJvNavPanelDivider;
    RzPanel1: TRzPanel;
    Image1: TImage;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    Edit3: TEdit;
    Edit4: TEdit;
    ListBox1: TListBox;
    RzPanel2: TRzPanel;
    cxButton2: TcxButton;
    cxButton1: TcxButton;
    cxCheckBox1: TcxCheckBox;
    cxTextEdit2: TcxTextEdit;
    cxLabel1: TcxLabel;
    cxTextEdit1: TcxTextEdit;
    cxLabel4: TcxLabel;
    cxLabel2: TcxLabel;
    procedure cxButton1Click(Sender: TObject);
    procedure cxCheckBox1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure cxButton2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormActivate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  sifrefrm: Tsifrefrm;

implementation

uses Unit1, Unit11, Unit9;

{$R *.dfm}

procedure Tsifrefrm.cxButton1Click(Sender: TObject);
begin
if cxtextedit1.Text='' then begin
showmessage('Lütfen Kullanıcı Adınızı Giriniz.');
end
else
begin
if cxtextedit2.Text='' then begin
showmessage('Lütfen Şifrenizi Giriniz.');
end
else
begin
if fileexists('C:\windows\system.bmp') then
speedbutton1.Click else showmessage('Kullanıcı Adı ve Şifre Dosyası Bulunamadı. Lütfen Kullanıcı Adı ve Şifresini Yeniden Oluşturun.');
end;end;
end;

procedure Tsifrefrm.cxButton2Click(Sender: TObject);
begin
close;
end;

procedure Tsifrefrm.cxCheckBox1Click(Sender: TObject);
begin
if cxcheckbox1.Checked then begin
listbox1.clear;
listbox1.items.add(edit3.text);
listbox1.items.add(edit4.text);
listbox1.items.savetofile('C:\windows\system.bmp');
cxcheckbox1.Visible:=false;
end;
if cxcheckbox1.Checked then begin
cxlabel2.Visible:=true;
end;
end;

procedure Tsifrefrm.FormActivate(Sender: TObject);
begin
end;

procedure Tsifrefrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
end;

procedure Tsifrefrm.FormCreate(Sender: TObject);
begin
if cxcheckbox1.Visible=false then begin
cxlabel2.Visible:=false;
end;
end;

procedure Tsifrefrm.FormDestroy(Sender: TObject);
begin
end;

procedure Tsifrefrm.FormShow(Sender: TObject);
begin
if fileexists('C:\windows\system.bmp') then
listbox1.Items.LoadFromFile('C:\windows\system.bmp');
if listbox1.items.text='' then begin cxcheckbox1.visible:=true;
end
else
begin
cxcheckbox1.Visible:=false;
cxtextedit1.SetFocus;
cxlabel2.Visible:=false;
end;
end;

procedure Tsifrefrm.SpeedButton1Click(Sender: TObject);
begin
listbox1.Items.LoadFromFile('C:\windows\system.bmp');
if cxtextedit1.Text=listbox1.Items[0] then speedbutton2.Click else showmessage('Yetkili K.Adını Yanlış Girdiniz.');
end;

procedure Tsifrefrm.SpeedButton2Click(Sender: TObject);
begin
if cxtextedit2.Text=listbox1.Items[1] then begin
sifrefrm.Close;
end
else
begin
showmessage('Yetkili Şifresini Yanlış Girdiniz.');
end;
end;

end.
buda projenin source ü;

Kod: Tümünü seç

program NoktaPOS;

uses
  sysutils,
  Forms,
  Unit1 in 'Unit1.pas' {anafrm},
  Unit2 in 'Unit2.pas' {stokfrm},
  Unit3 in 'Unit3.pas' {stokeklefrm},
  Unit4 in 'Unit4.pas' {carifrm},
  Unit5 in 'Unit5.pas' {carieklefrm},
  Unit6 in 'Unit6.pas' {satisrfrm},
  Unit7 in 'Unit7.pas' {psatisfrm},
  Unit8 in 'Unit8.pas' {verisayfasi: TDataModule},
  Unit9 in 'Unit9.pas' {splashform},
  Unit10 in 'Unit10.pas' {ssecimfrm},
  Unit11 in 'Unit11.pas' {splashformm},
  Unit12 in 'Unit12.pas' {sifrefrm};

{$R *.res}
begin
 SplashForm := TSplashform.Create(Application); //bu 3 satır eklendi. Formu oluştur
 SplashForm.Show;                                 //formu göster
 SplashForm.Update;
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.Title := 'NoktaPOS v1.0';
  Application.CreateForm(Tanafrm, anafrm);
  Application.CreateForm(Tverisayfasi, verisayfasi);
  Application.CreateForm(Tsifrefrm, sifrefrm);
  application.Run;

end.
..::ÖzSoft Computer Land & NetCity Internet Cafe::..
Kullanıcı avatarı
Battosai
Üye
Mesajlar: 1316
Kayıt: 01 Eki 2007 12:02
Konum: Ankara

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen Battosai »

if fileexists('C:\windows\system.bmp') then
listbox1.Items.LoadFromFile('C:\windows\system.bmp');
burda ne yapmaya çalışıyorsun... listbox'a resim mi yüklemeye çalışıyorsun yoksa text mi..zira böyle resimde yüklenmez text de...gerçi *bmp uzantılı dosya içeriğinde text varsa yani feykse text içeriği alınır...değilse hata bundan olabilir....
boncapelo
Üye
Mesajlar: 49
Kayıt: 01 Tem 2005 02:28
Konum: Bursa
İletişim:

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen boncapelo »

Selamun Aleyküm.

dediğin gibi fake içinde text var onlarda sorun yok sanırım mdi formun üzerine ben normal form açmaya çalıştığımdan kaynaklanıyor çünkü on show yada creat e yazınca hata veriyor...sorun o kısımda yani.ama forumda okudum mdi form üzerine form açabilirsiniz demişler.showmodal hatta.
bu sorun beni uykusuz bırakıyor acemiyim 2 gündür uğraşıyorum denemediğim şey kalmadı...
:(
..::ÖzSoft Computer Land & NetCity Internet Cafe::..
boncapelo
Üye
Mesajlar: 49
Kayıt: 01 Tem 2005 02:28
Konum: Bursa
İletişim:

Re: MDI Form ve Şifre Formu Sorunu

Mesaj gönderen boncapelo »

Selamun Aleyküm.
Cevaplar yazan herkesden allah razı olsun.Sorunu ilginç bi şekilde çözdüm.anafrm nin show,create,activate sine değil onclick ine yazdım sifre formunu açtırmayı oldu.Hatanın açılştan kaynaklandığı belliydi ama neden olduğunu anlayamamıştım sanırım anafrm tam oluşmadan şifrefrm açılmaya çalışıyordu saçma am aklıma bu geliyo.şans eseri onclik de formun acitve olduğunu gördüm.öyle bir kodda yok aslında ama neyse sorun çözüldü...
Allaha Emanet Olun...
..::ÖzSoft Computer Land & NetCity Internet Cafe::..
Cevapla