문제

i have a Delphi7.

I use this article: http://www.delphidabbler.com/articles?article=22&part=2 / Step 2

Now, i created a problem with LoadTypeLib (undefined):

type
  TMyClass = class(TAutoIntfObject, IMyIntf, IDispatch)
    constructor Create();
  protected
    procedure helloWorld(); safecall;
  end;

implementation

constructor TMyClass.Create();
var
  TypeLib: ITypeLib;
  s: WideString;
begin
  s := ParamStr(0);
  OleCheck(LoadTypeLib(PWideChar(s), TypeLib)); // ERR:LoadTypeLib is undefined.
  inherited Create(TypeLib, IMyCallback); 
end;

Any suggestions?

도움이 되었습니까?

해결책

In Delphi 7, the LoadTypeLib function is declared in the ActiveX unit. You must include that unit in your uses clause.

You can find this stuff out for yourself the exact same way that I did it – by searching the source code. Use the Find in Files feature, search for the name of the symbol that is not declared, and search under the Source directory of your Delphi installation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top