Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 26-01-2007
Negegoca Negegoca is offline
Registrado
 
Registrado: dic 2006
Ubicación: Costa Rica
Posts: 1
Poder: 0
Negegoca Va por buen camino
Question In Design: Control no has parent window

Tengo varios días tratando de corregir este error, solo me da en tiempo de diseño, basicamente es un TEdit multi-uso (Alianeación, numeros con formato, decimales, un caracter fijo, etc), el componente funciona perfectamente en run-time, pero en Design-time me da el error: 'Control "TEditEx1" no has parent window' y lo borra del formulario. He leido varios foros (en ingles) y no dan una solución concreta solo dicen que el error se da en "CreateWnd" de TWinControl. Pongo el código para que se den una idea...

Código Delphi [-]
{**** TCustomEditEx *****}
constructor TCustomEditEx.Create(AOwner: TComponent);
begin
   Inherited Create(AOwner);
   FRangeChar := [];
   FFixedChar := #0;
   FFixedPos := fpLeft;
   FHasSign := False;
   FDecimals := 0;
   FThousands := False;
   FNumPadDot := False;
   FValidChars := [];
   FPorcent := False;
   Formating := False;
   _FixedChar := False;
   FCreating := True;
   FAlignment := taLeftJustify;
   FRangeChar := [rcNumber, rcAlpha, rcSymbol, rcExtended];
end;

procedure TCustomEditEx.CreateWnd;
var
  FixedWidth: LongInt;
begin
   FCreating := True;
  try
     inherited CreateWnd; { <-- Aquí adentro es el error, especificamente en TWinControl.CreateWnd: 
     ... 
     if (WndParent = 0) and (Style and WS_CHILD <> 0) then
        if (Owner <> nil) and (csReading in Owner.ComponentState) and
           (Owner is TWinControl) then
           WndParent := TWinControl(Owner).Handle
        else
           raise EInvalidOperation.CreateFmt(SParentRequired, [Name]);
     ... 
     }
  finally
     FCreating := False;
  end;
  if FFixedChar <> #0 then
   begin
      if FFixedPos = fpLeft then
         FixedWidth := MakeLong(GetFixedWidth, 0)
      else
         FixedWidth := MakeLong(0, GetFixedWidth);
      SendMessage(Handle, EM_SETMARGINS, EC_LeftMargin or EC_RightMargin, FixedWidth);
   end;
end;

procedure TCustomEditEx.CreateParams(var params: TCreateParams);
const
   Styles : Array [TAlignment] of DWORD = (ES_LEFT, ES_RIGHT, ES_CENTER );
begin
   inherited;
   params.style := params.style or Styles[FAlignment];
end;

destructor TCustomEditEx.Destroy;
begin
   inherited Destroy;
end;

Elimine todo posible llamada al Api o al VCL usando tecnicas de Borland pero nada, sigue el mismo error...


Si quieren todo el resto del código, solo diganme donde subirlo

Estaba identado, no se que paso cuando lo pegé... :-p

Última edición por Negegoca fecha: 27-01-2007 a las 06:53:33.
Responder Con Cita
  #2  
Antiguo 26-01-2007
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
Por favor, indenta tu código. Es muy difícil entenderlo así.

// Saludos
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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
Array de controles - Control has no parent window SyncReuter OOP 8 24-01-2007 02:21:14
error con el parent window antonio peña Varios 1 04-10-2006 10:18:50
QReport has no parent window david duarte Impresión 1 19-01-2006 15:06:07
Ayuda: Control Has No Parent Window pelaorb68 Varios 10 20-12-2005 20:36:26


La franja horaria es GMT +2. Ahora son las 17:33:26.


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