作系统是遇到了一个不是问题的问题。具体描述如下:
unit1 u_stock;
.....public 
   bill:string;//注意这边。
private
  ...
end
var
  fr_stock: Tfr_stock;  
implementation     procedure Tfr_stock.BitBtn2Click(Sender: TObject);
var
   fr_money_out:Tfr_money_out;
begin
  try
        bill_id:=cmb_rk_id.Text;//还有这边
        fr_money_out:=Tfr_money_out.Create(application);
        postmessage(fr_money_out.Handle,msg_money,0,0);
        fr_money_out.Show;
  except
  end;
end;
unit u_money_out;
interface
...
...
  private
    procedure ProcessMyMsg(var msg:TMessage);Message msg_money;
end;
var
  fr_money_out: Tfr_money_out;
implementation
  uses
     u_stock;
{$R *.dfm}
procedure Tfr_monty_out.ProcessMyMsg(var msg:TMessage);
begin
  cmb_bill_id.Text:=fr_stock.bill_id;//出错bill_id 调用的是 fr_stock 中声明的。
end;
end.具体出错信息如下:
   ---------------------------
   Debugger Exception Notification
  ---------------------------
  Project p_cshgl.exe raised exception class EAccessViolation with    message 'Access violation at address 0040489F in module 'p_cshgl.exe'. Read of address 0000004A'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help   
---------------------------我的 fr_stock和fr_money_out 都是在使用的时候动态创建的。不是在 program 运行时
就创建的。如果让他们在运行时就创建的话,就不出错,为什么??很急,摆脱各位了。

解决方案 »

  1.   

    这句cmb_bill_id.Text:=fr_stock.bill_id;之前fr_stock还没有创建吧—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————
      

  2.   

    各位注意:
    fr_stock 调用的是fr_money_out