for j:=0 to screen.Imes.Count-1 do 
  begin 
    BB[j]:=screen.imes.strings[j]; 
end; 
以上这样好象总是报内存错!
谢谢!

解决方案 »

  1.   


    SetLength(bb,screen.Imes.Count);
    for j:=0 to screen.Imes.Count-1 do
      begin
        BB[j]:=screen.imes.strings[j];
    end;
      

  2.   


    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type  TAgeData = array  of string; {------------声明}
      TForm1 = class(TForm)
        Button1: TButton;
        ListBox1: TListBox;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
         public
        { Public declarations }
      end;var
      Form1: TForm1;
      function lst:TAgeData;{------------------------声明返回数组的函数}
    implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
    a:TAgeData;
    i:integer;
    begin
     {---------------------将输入法列表添加到ListBox1中}
     a:=lst;
     for i :=low(a)  to High(a) do
      ListBox1.Items.Add(a[i]);
    end;function lst:TAgeData; {---------------------函数实体}
    var
    bb:TAgeData;
    j:integer;
    begin
    SetLength(bb,screen.Imes.Count);
    for j:=0 to screen.Imes.Count-1 do
      begin
        BB[j]:=screen.imes.strings[j];
     end;
    Result:=bb;
    SetLength(bb,0);
    end;end.
      

  3.   

    请问把中文输入法改成英文,如何使用ImmsimulateHotkey函数?