| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1822 人关注过本帖
标题:delphi7调用DLL链接库总是出错,大神帮我看看
只看楼主 加入收藏
shiwenwu999
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2021-1-4
收藏
 问题点数:0 回复次数:1 
delphi7调用DLL链接库总是出错,大神帮我看看
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, ActProgTypeLib_TLB,WinSock;



type
  TForm1 = class(TForm)
    btn1: TButton;
    btn2: TButton;
    edt1: TEdit;
    edt2: TEdit;
    edt3: TEdit;
    edt4: TEdit;
    btn3: TButton;
    actmlprgtyp1: TActMLProgType;
    procedure btn1Click(Sender: TObject);
    procedure btn2Click(Sender: TObject);
    procedure btn3Click(Sender: TObject);





    //int WSAStarup(WORD wVersionRequested,LPWSADATA lpWSAData);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  type
  LKIF_OPENPARAM_ETHERNET= record
  IPAddress: in_addr;
  end;
  {type
    in_addr = record
    S_addr: Integer;
  end;   }
var

  Form1: TForm1;




implementation




var
  m_points: array [0..4800] of Double ;
  m_points_X: array [0..4800] of Double ;
  m_points_Y: array [0..3600] of Double ;


{$R *.dfm}
function LKIF2_OpenDeviceETHER(OpenParam: LKIF_OPENPARAM_ETHERNET):Integer;cdecl;external'C:UsersAdministratorDesktop软件 - 副本LKIF2.dll';

procedure TForm1.btn1Click(Sender: TObject);

var
  i:Integer;
  X1,X2,X3,Y1,Y2,Y3,X1Y1,X1Y2,X2Y1: Double;
  C,D,E,G,H,N: Double;
  A,B,R: Double;
  a1,b1,c1: Double;
  Q:Double;

begin

X1:=0 ; Y1:=0; X2:=0; Y2:=0; X3:=0; Y3:=0; X1Y1:=0;
X1Y2:=0; X2Y1:=0;
   for i:=0 to 4 do
   begin
      Q:= (360/4)* (i-0)*3.1415/180;

      m_points_X[i]:= m_points[i]* Cos(Q);
      m_points_Y[i]:= m_points[i]* Sin(Q);

      X1:= X1 + m_points_X[i];
      Y1:= Y1 + m_points_y[i];
      X2:= X2 + m_points_X[i]* m_points_X[i];
      Y2:= Y2 + m_points_Y[i]* m_points_y[i];
      X3:= X3 + m_points_x[i]* m_points_x[i] * m_points_x[i];
      Y3:= Y3 + m_points_y[i]* m_points_y[i] * m_points_y[i];
      X1Y1:= X1Y1 + m_points_x[i]* m_points_y[i];
      X1Y2:= X1Y2 + m_points_x[i]* m_points_y[i] * m_points_y[i];
      X2Y1:= X2Y1 + m_points_x[i]* m_points_x[i] * m_points_y[i];
   end;

      N:= i-1;
      C:=  N* X2 - X1*X1;
      D:= N* X1Y1 - X1* Y1;
      E:= N*X3 + N* X1Y2- (X2+ Y2)* X1;
      G:= N* Y2- Y1* Y1;
      H:= N* X2Y1 + N* Y3 -(X2+ Y2)* Y1;

      a1:= (H* D - E * G)/ (C * G - D * D);
      b1:= (H* C - E * D)/ (D * D - G * C);
      c1:= -(a1* X1 + b1* Y1+ X2+ Y2)/N;

      A:=a1/(-2);
      B:= b1/(-2);
      R:= Sqrt(a1* a1+ b1*b1- 4* c1)/2;



end;

procedure TForm1.btn2Click(Sender: TObject);

var
  L,H,M:Double;
  KK:pchar;
begin

    m_points[0]:= StrToFloat(edt1.Text);
    m_points[1]:= StrToFloat(edt2.Text);
    m_points[2]:= StrToFloat(edt3.text);
    m_points[3]:= StrToFloat(edt4.Text);

   //edt3.Text:=FloatToStr(StrToFloat(edt1.Text) * StrToFloat(edt2.Text));
end;

procedure TForm1.btn3Click(Sender: TObject);
 var
   OpenParam: LKIF_OPENPARAM_ETHERNET;
   IPAddres:PAnsiChar;


begin

   IPAddres:= '192.168.10.10';

    OpenParam.IPAddress.S_addr:=inet_addr(IPAddres);
  
    LKIF2_OpenDeviceETHER(OpenParam);
end;

end.
搜索更多相关主题的帖子: Text Sender procedure 
2021-01-27 11:38
supermay
Rank: 1
等 级:新手上路
威 望:1
帖 子:34
专家分:0
注 册:2004-10-3
收藏
得分:0 
没有给出错误信息。

2021-10-20 09:13
快速回复:delphi7调用DLL链接库总是出错,大神帮我看看
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035372 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved