我是出学者.请问如何像在VB下引用那样使用组件服务
自己做的DLL在VB下可以引用,在Delphi下不知道要如何使用,请大家帮忙!

解决方案 »

  1.   

    还请教Delphi下如何得到本机的IP地址?
      

  2.   

    一个例子:
    function QueryExit(Caption:string):boolean;
    var
      FormDll:THandle;
      moExitDlg : function (Caption:pchar ):integer;stdcall;
    begin
      result:=False;
      FormDll:=LoadLibrary('Form.dll');
      if FormDll=0 then
        raise  Exception.Create('Can not Load Form.dll');
      try
        @moExitDlg := GetProcAddress( FormDll,'moExitDlg');
        if @moExitDlg=nil then
           raise  Exception.Create('Can not load function moExitDlg of Form.dll');    
        Result:=moExitDlg(pchar(Caption))=IDOK;
      finally
        FreeLibrary(FormDll);
      end;
    end;
    另外:不建议你用一个帖子问多个问题
    你要是用过搜索你就知道为什么了。