Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 02-05-2008
petitrad petitrad is offline
Registrado
 
Registrado: abr 2008
Posts: 7
Poder: 0
petitrad Va por buen camino
Aun marca error de memoria

aun me marca el mismo error, aqui esta el codigo que utilizo en las formas

Código Delphi [-]
//Principal 
unit Principal;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, LMDControl, LMDBaseControl, LMDBaseGraphicButton,
  LMDCustom3DButton, LMD3DEffectButton, ExtCtrls, StdCtrls,
  LMDCustomControl, LMDCustomPanel, LMDCustomBevelPanel, LMDSimplePanel,
  LMDCustomShapeButton, LMDShapeButton, LMDCustomParentPanel, LMDBackPanel;
type
  TMain = class(TForm)
    LogoQS: TImage;
    Panel1: TPanel;
    LetrasLP: TImage;
    NUsuario: TLabel;
    Fecha: TLabel;
    Hora: TLabel;
    Panel2: TPanel;
    LMDSimplePanel8: TLMDSimplePanel;
    BVentas: TLMDShapeButton;
    LMDSimplePanel9: TLMDSimplePanel;
    BCompras: TLMDShapeButton;
    LMDSimplePanel10: TLMDSimplePanel;
    BCuentasCobrar: TLMDShapeButton;
    LMDSimplePanel11: TLMDSimplePanel;
    BCuentasPagar: TLMDShapeButton;
    LMDSimplePanel12: TLMDSimplePanel;
    BReportes: TLMDShapeButton;
    LMDSimplePanel14: TLMDSimplePanel;
    BInventario: TLMDShapeButton;
    LMDSimplePanel13: TLMDSimplePanel;
    BUtilidades: TLMDShapeButton;
    LMDSimplePanel15: TLMDSimplePanel;
    BPalm: TLMDShapeButton;
    LMDSimplePanel16: TLMDSimplePanel;
    BSalir: TLMDShapeButton;
    procedure BSalirClick(Sender: TObject);
    procedure FormClick(Sender: TObject);
    procedure LMDSimplePanel8MouseEnter(Sender: TObject);
    procedure LMDSimplePanel9MouseEnter(Sender: TObject);
    procedure LMDSimplePanel10MouseEnter(Sender: TObject);
    procedure LMDSimplePanel11MouseEnter(Sender: TObject);
    procedure LMDSimplePanel12MouseEnter(Sender: TObject);
    procedure LMDSimplePanel13MouseEnter(Sender: TObject);
    procedure LMDSimplePanel14MouseEnter(Sender: TObject);
    procedure LMDSimplePanel15MouseEnter(Sender: TObject);
    procedure LMDSimplePanel16MouseEnter(Sender: TObject);
    procedure LogoQSClick(Sender: TObject);
    procedure LetrasLPClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BVentasClick(Sender: TObject);
    procedure BComprasClick(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
    procedure AbreCotizacion();
  end;
var
  Main: TMain;
implementation
uses Ventas, MenuV, MenuC, MenuCC, MenuCP, MenuI, MenuR, MenuU, Compras,
  Cotizaciones;
{$R *.dfm}
procedure TMain.BSalirClick(Sender: TObject);
var
        I: integer;
begin
//cierra todas las ventanas que esten abiertas
for I := 0 to Screen.FormCount - 1 do
       Screen.Forms[i].Close;
Close;
end;
procedure pantalla_completa();
var
  HTaskbar : HWND;
begin
  TRY     //Obtener el  handle del Taskbar de Windows
    HTaskBar:=FindWindow('Shell_TrayWnd',nil );
    EnableWindow(HTaskBar,False);  //Deshabilitar el Taskbar
    ShowWindow(HTaskbar,SW_HIDE);   //Esconder el Taskbat
  FINALLY
    With  Main  do begin
      BorderStyle :=bsNone;
    //  FormStyle :=fsStayOnTop;
      Left :=0;
      Top :=0;
      Height :=Screen.Height;
      Width :=Screen.Width;
    end;
  END //FINALLY    end;
end;
procedure restaurar_pantalla_completa();
var
  HTaskbar : HWND;
  OldVal : LongInt;
begin
    HTaskBar:=FindWindow('Shell_TrayWnd',nil );
    SystemParametersInfo (97, Word (False), @OldVal, 0); //solo en Win 95/98/ME
    EnableWindow(HTaskBar,True);
    ShowWindow(HTaskbar,SW_SHOW);
end;
procedure TMain.FormClick(Sender: TObject);
begin
        //Esconde todos los menus.
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel8MouseEnter(Sender: TObject);
begin
        //Muestra Menu Ventas
        MVentas.Show;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel9MouseEnter(Sender: TObject);
begin
        //Muestra Menu Compras
        MVentas.Hide;
        MCompras.Show;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel10MouseEnter(Sender: TObject);
begin
        //Muestra Menu  Cuentas Por Cobrar
        MCC.Show;
        MVentas.Hide;
        MCompras.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel11MouseEnter(Sender: TObject);
begin
        //Muestra Menu Cuentas Por Pagar
        MCP.Show;
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel12MouseEnter(Sender: TObject);
begin
        //Muestra Menu Reportes
        MReportes.Show;
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel13MouseEnter(Sender: TObject);
begin
        //Muestra Menu Utilidades
        MUtilidades.Show;
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel14MouseEnter(Sender: TObject);
begin
        //Muestra Menu Inventarios
        MInventario.Show;
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
end;
procedure TMain.LMDSimplePanel15MouseEnter(Sender: TObject);
begin
        //Esconde todos los menus
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LMDSimplePanel16MouseEnter(Sender: TObject);
begin
        //Esconde todos los menus
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LogoQSClick(Sender: TObject);
begin
        //Esconde todos los menus
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.LetrasLPClick(Sender: TObject);
begin
        //Esconde todos los menus
        MVentas.Hide;
        MCompras.Hide;
        MCC.Hide;
        MCP.Hide;
        MReportes.Hide;
        MUtilidades.Hide;
        MInventario.Hide;
end;
procedure TMain.FormCreate(Sender: TObject);
var
  stSystemTime : TSystemTime;
begin
  Windows.GetLocalTime( stSystemTime );
  Hora.Caption := DateTimeToStr( SystemTimeToDateTime( stSystemTime ) );
  pantalla_completa();
end;
procedure TMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  restaurar_pantalla_completa();
end;
procedure TMain.BVentasClick(Sender: TObject);
begin
        //Crea y abre la ventana de ventas en modo Hija.
        if venta = nil then
        begin
              venta := TVenta.Create(self);
              venta.FormStyle := fsMDIChild;
              venta.Left :=0;
              venta.Top :=0;
              venta.Width:=Screen.Width-15;
              venta.Height:= Screen.Height-50;
              venta.Parent     :=  self;
        end;
        venta.Show;
end;
procedure TMain.BComprasClick(Sender: TObject);
begin
//Pendientes todas las formas
        Compra.Show;
end;
procedure TMain.AbreCotizacion();
begin
        Cotizacion.Show;
end;

End.
 
 
 
// Ventana Hija.
 
 
unit Ventas;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, LMDControl, LMDBaseControl, LMDBaseGraphicButton,
  LMDCustom3DButton, LMD3DEffectButton, LMDCustomControl, LMDCustomPanel,
  LMDCustomBevelPanel, LMDSimplePanel, StdCtrls, LMDCustomShapeButton,
  LMDShapeButton, Grids;
type
  TVenta = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Image3: TImage;
    Bevel1: TBevel;
    LabeledEdit1: TLabeledEdit;
    LabeledEdit2: TLabeledEdit;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Bevel3: TBevel;
    Bevel4: TBevel;
    Image4: TImage;
    LabeledEdit3: TLabeledEdit;
    LabeledEdit4: TLabeledEdit;
    LabeledEdit5: TLabeledEdit;
    LabeledEdit6: TLabeledEdit;
    LabeledEdit7: TLabeledEdit;
    LMDShapeButton1: TLMDShapeButton;
    StringGrid1: TStringGrid;
    LabeledEdit8: TLabeledEdit;
    LMDShapeButton2: TLMDShapeButton;
    LabeledEdit9: TLabeledEdit;
    LabeledEdit10: TLabeledEdit;
    LabeledEdit11: TLabeledEdit;
    LMDShapeButton3: TLMDShapeButton;
    LMDShapeButton4: TLMDShapeButton;
    LabeledEdit12: TLabeledEdit;
    LMDShapeButton5: TLMDShapeButton;
    procedure LMDShapeButton4Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Venta: TVenta;
implementation
uses Principal;
{$R *.dfm}

procedure TVenta.LMDShapeButton4Click(Sender: TObject);
begin
        Close;
end;
procedure TVenta.FormClose(Sender: TObject; var Action: TCloseAction);
begin   
        Action := caFree;
        Venta := nil;
end;
end.

aun asi no funciona cambiando el action a la parte de abajo.

espero que me puedan ayudar.

Última edición por roman fecha: 02-05-2008 a las 03:36:53. Razón: Añadir etiqueta [delphi]
Responder Con Cita
  #2  
Antiguo 02-05-2008
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
petitrad: Por favor utiliza la etiqueta [delphi] para publicar código. Por esta vez te la he puesto yo para que veas la diferencia. Entra a editar tu mensaje para que veas cómo se usa.

// Saludos
Responder Con Cita
  #3  
Antiguo 02-05-2008
Avatar de jcarteagaf
[jcarteagaf] jcarteagaf is offline
Miembro Premium
 
Registrado: abr 2006
Ubicación: La Paz, Bolivia
Posts: 651
Poder: 19
jcarteagaf Va por buen camino
Podrias colocar los mensajes exactos que te marca?

El mensaje de Access violation en que momento ocurre?

Eso servira para identificar mejor tu problema.
Responder Con Cita
  #4  
Antiguo 02-05-2008
petitrad petitrad is offline
Registrado
 
Registrado: abr 2008
Posts: 7
Poder: 0
petitrad Va por buen camino
Errores

Ok, gracias moderador.

Los errores son los siguientes

project QSoft.exe raised exception class EAccessViolation with message 'Access violation at address 000000000. Read of adress 000000000'. Process stopped. use step or run to continue.

este error me marca al intentar reabrir la ventana y en onclose del form hija donde pongo el action := cafree y el ventana := nil, pero me marca otro erro al salir del programa que es:

Exception EAccessViolation in module vcl60.bpl at 0003fd57
Access violation at adress 005dfd57 in module 'vcl60.bpl'. read of adress 00000254.

espero que me puedan ayudar.
Responder Con Cita
  #5  
Antiguo 03-05-2008
petitrad petitrad is offline
Registrado
 
Registrado: abr 2008
Posts: 7
Poder: 0
petitrad Va por buen camino
Cerrar pantallas hijas

ya encontre el error, el detalle esta aqui, que si le pongo:

Ventana.parent := self, lo hace como yo quiero pero me marca error al cerrarla, si no le pongo eso si lo hace y se cierra y se puede abrir de nuevo, pero como podria utilizar esta propiedad y cuando lo cierre quitarsela, intente ponerle en nil pero al parecer me manda a nil el principal tambien bueno espero me puedan ayudar ya que es un proyecto importante para la escuela.

hasta pronto.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Busco un consejo (muchas ventanas hijas y muchos menús) ixMike Varios 9 14-09-2006 11:23:34
Recorrido de ventanas hijas sur-se OOP 3 23-08-2004 11:43:10
La señora y sus hijas roman Humor 24 28-05-2004 19:46:20
Ventanas MDI Hijas LucianoRey OOP 4 25-02-2004 01:28:32
Problemas con formas Hijas (MDI Child) D.M Varios 1 10-09-2003 22:56:30


La franja horaria es GMT +2. Ahora son las 10:42:27.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi