函数实现的功能很简单,就是判断MDIChild窗口是否已经打开,函数声明在窗口类中
-------------------------------------------------------------------------------
type
  TF_MainMenu = class(TForm)
  Menu_main: TMainMenu;
  ……
  public
function ShowMenu(MenuName:String):boolean;
end;
------------------------------------------------------------------------------
但是,程序报错,提示说:
Unsatisfied forward or external declaration: 'TF_MainMenu.ShowMenu'
若是把函数放在private中,照样报错。
我百思不得其解,请问如何解决这个问题,谢谢。
附上函数
-------------------------------------------------------------------------------
function ShowMenu(MenuName:String):boolean;
var i:integer;
begin
      Result:=false;
      for i:=0 to screen.FormCount-1 do
        if screen.Forms[i].Name=MenuName then
        begin
            Result:=true;  // 找到
            screen.Forms[i].Show;
            break;
        end;
end;
-----------------------------------------------------------------------------

解决方案 »

  1.   

    function TF_MainMenu.ShowMenu(MenuName:String):boolean;
    var i:integer;
    begin
          Result:=false;
          for i:=0 to screen.FormCount-1 do
            if screen.Forms[i].Name=MenuName then
            begin
                Result:=true;  // 找到
                screen.Forms[i].Show;
                break;
            end;
    end;