Control<>has no parent window (控件<>没有父窗口)(50分)

  • 主题发起人 主题发起人 扶程星云
  • 开始时间 开始时间

扶程星云

Unregistered / Unconfirmed
GUEST, unregistred user!
我调用一dll,该dll含from,内有若干Tedit控件,运行时,在任一Tedit控件按鼠标右键均提示没有父窗口,我知道有人解决过,但他没有讲方法,请有知道者告知。谢谢!
 
应该是DLL代码有问题,把代码也帖出来吧!
 
unit Rpt6201;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, AbstractRBReport, ppBands, ppCache, ppClass, ppComm, ppRelatv,
ppProd, ppReport, ppViewr, ExtCtrls, ADODB, ComCtrls, StdCtrls, DB, ppDB,
ppDBPipe, ppDBBDE, ppCtrls, ppVar, ppPrnabl, ppParameter, ppModule,
daDataModule;

type
TfrmRpt6201 = class(TfrmAbstractRBReport)
Label7: TLabel;
Label6: TLabel;
Label3: TLabel;
edName: TEdit;
Label1: TLabel;
edBgn: TEdit;
Label2: TLabel;
edEnd: TEdit;
Label4: TLabel;
fromDate: TDateTimePicker;
Label5: TLabel;
toDate: TDateTimePicker;
dsClDetail: TDataSource;
ppBDEPipeline1: TppBDEPipeline;
adsAccountBook: TADODataSet;
ppGroup1: TppGroup;
ppGroupHeaderBand1: TppGroupHeaderBand;
ppGroupFooterBand1: TppGroupFooterBand;
ppLabel1: TppLabel;
ppLine1: TppLine;
ppLabel2: TppLabel;
ppDBText1: TppDBText;
ppLabel4: TppLabel;
ppDBText2: TppDBText;
ppLabel5: TppLabel;
ppDBText3: TppDBText;
ppLabel10: TppLabel;
ppLabel9: TppLabel;
ppLabel8: TppLabel;
ppLabel6: TppLabel;
ppLabel11: TppLabel;
ppLabel7: TppLabel;
ppDBText4: TppDBText;
ppDBText5: TppDBText;
ppDBText7: TppDBText;
ppDBText8: TppDBText;
ppDBText9: TppDBText;
ppLine3: TppLine;
ppLabel13: TppLabel;
ppLabel14: TppLabel;
ppLabel16: TppLabel;
ppDBCalc3: TppDBCalc;
ppDBCalc2: TppDBCalc;
ppLabel15: TppLabel;
ppSystemVariable2: TppSystemVariable;
ppSummaryBand1: TppSummaryBand;
ppLine4: TppLine;
ppLabel17: TppLabel;
ppLabel18: TppLabel;
ppDBCalc4: TppDBCalc;
ppLabel19: TppLabel;
ppDBCalc6: TppDBCalc;
ppDBCalc5: TppDBCalc;
ppDBCalc1: TppDBCalc;
ppDBText10: TppDBText;
ppLabel21: TppLabel;
ppSystemVariable3: TppSystemVariable;
private
FDatabase: TADOConnection;
FSQL: string;
public
constructor Create(ADatabase: TADOConnection); reintroduce;
procedure SetDatabase(ADatabase: TADOConnection); override;
procedure Preview; override;
function GetGroupNO: integer; override;
function GetGroupCName: string; override;
function GetGroupEName: string; override;
function GetNO: integer; override;
function GetCName: string; override;
function GetEName: string; override;
function GetPrintPrivilegeNO: integer; override;
function GetViewPrivilegeNO: integer; override;
end;

var
frmRpt6201: TfrmRpt6201;

implementation

uses LocalPubUnit;
后面的代码没关系,为了节省空间就不贴了。
 
你的dll导出函数中创建窗体中,应该用
TFrmXXX.Create(Application)
这样就就有了Owner,
如果是Mdi结构,要非模式显示这个窗体,
要吧MainForm的Handle赋给Application的handle
 
不行,但决定终止该问题。
 
后退
顶部