unit testocx;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, ETESNMMSLib_TLB;type
  TForm1 = class(TForm)
    ConnectModem: TButton;
    InitModel: TButton;
    SendSMS: TButton;
    Exit: TButton;
    DisConnectModem: TButton;
    SendMMS: TButton;
    EtesnMMS1: TEtesnMMS;
    procedure InitModelClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.InitModelClick(Sender: TObject);
var nRes:integer;
begin
  nRes:=etesnmms1.InitModel('C:\RecvMMS',7,1,101,1);
  if(nRes>0)
     then begin
       showMessage('初始化控件成功,已找到加密狗!');
       if(nRes=0)
         then begin
          ShowMessage('初始化失败,未找到加密狗');
       if(nRes=-4)
         then begin ShowMessage('初始化失败,不支持的加密狗类型');
              end;
              end;
         end;end;错误提示:
[Error] testocx.pas(67): Declaration expected but end of file found
[Fatal Error] ocx.dpr(5): Could not compile used unit 'testocx.pas'小弟初学delphi,不懂,谢谢您的回复。谢谢。

解决方案 »

  1.   

    谢谢。为什么会加一个end.呢?我看书上都没有呀,都只是一个end;就完了。另外:现在通过了,可编译时出现:存取地址014a2ebd违例发生在模块'etesnmms.oc‘中,读在地址000000004里。 这个控件是标准的控件,已经加载了。请问是什么原因。谢谢
      

  2.   

    具体提示为:Project.exe raised eception class EaccessViolation with messge'存取地址014A2EBD违例发生在模块'EtesnMMS.ocx'中,读在地址000000004里’,Process stopped,use step or Run to continue。
    可这个控件在vc里都是正常的呀。