我在implementation 下添加了两行 调用DLL的代码如下:
implementation
{$R *.dfm}
procedure openport(var command:string);stdcall;external'EZWeb.dll';
procedure closeport();stdcall;external'EZWeb.dll';添加了一个按扭 事件如下
procedure TfrmLabelPrinting.SeSkinButton8Click(Sender: TObject);
var
s:String;
begin
  inherited;
  s := '\\Wing\Godex EZ-1100 203dpi';
  openPort(s);
  closePort();
end;然后运行程序,在初始化中就已经报错了,出现 "The   application   failed   to   initialize   properly(0xc0000135).Click   on   OK   to   terminate   the   application "  错误是什么意思呢???
请大家帮帮忙

解决方案 »

  1.   

    EZWeb中接口是如何声明的,参数不要用string,要用pchar
      

  2.   


    procedure openport(var command:pchar);stdcall;external'EZWeb.dll'; 
    procedure closeport();stdcall;external'EZWeb.dll';  錯誤好像是傳遞的參數不對,造成的。你最好看下DLL中的如何寫的。或者看下人家的例子。
      

  3.   

    他有个VB的例子能教一教我该如果使用它刚学DELPHI不懂怎样去调用DLL
    感激不尽3. sample
    The following list  is a VB sample:Private Declare Sub beginjob Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal a%, ByVal b%, ByVal c%, ByVal d%, ByVal e%, ByVal f%)
    Private Declare Sub openport Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal command$)
    Private Declare Sub sendcommand Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal command$)
    Private Declare Sub intloadimage Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal filename$, ByVal image_name$, ByVal image_type$)
    Private Declare Sub extloadimage Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal filename$, ByVal image_name$, ByVal image_type$)
    Private Declare Sub ecTextOut Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal x%, ByVal y%, ByVal b%, ByVal c$, ByVal d$)
    Private Declare Sub endjob Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" ()
    Private Declare Sub closeport Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" ()
    Private Declare Function isready% Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" ()
    Private Sub command1_Click()
    Call openport("Godex EZ-4206(web)")
    Call beginjob (30, 5, 2, 1, 0, 0)
    Call sendcommand("^W50")
    Call sendcommand("^E23")
    Call sendcommand("^P1")
    Call sendcommand("^L")
    Call sendcommand("AC,20,60,1,1,1,0,TEST")
    Call ecTextOut(20, 10, 34, "細明體", "中文測試")
    Call sendcommand("E")
    Call endjob
    Call closeport
    End Sub
      

  4.   

    "The  application  failed  to  initialize  properly(0xc000007b).Click  on  OK  to  terminate  the  application " 
    现在是这个错误...编译能通过...一运行就报以上错误
      

  5.   

    应该就是参数问题,仔细检查一下吧,delphi中dll不要使用string类型参数
      

  6.   

    但我已经改为pchar还是不行呢
      

  7.   

    1、VB中参数全部用的是传值,因此在delphi中也应是传值,即
      procedure openport(command:string);stdcall;external'EZWeb.dll';2、DLL文件EZWeb.dll在没有在应用程序的目录下,没有将其拷过来3、  s := '\\Wing\Godex EZ-1100 203dpi'; 
    似乎想操作另外一台机器的Godex EZ-1100,查看说明这样支持吗?
      

  8.   


    Godex EZ-1100 203dpi是一台条型码打印机在Wing的PC下已经共享出来了
    Godex提供了ezweb.dll这个文件,可以进行二次开发...
    刚来公司就给这么难的任务我做...求你们帮帮忙...
      

  9.   

    procedure openport(var command:string);stdcall;external'EZWeb.dll'; 
    这个申明百分之百是错误的
    如果你能把DLL内的申明贴出来就可以很快解决问题。
      

  10.   


    3. sample 
    The following list  is a VB sample: Private Declare Sub beginjob Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal a%, ByVal b%, ByVal c%, ByVal d%, ByVal e%, ByVal f%) 
    Private Declare Sub openport Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal command$) 
    Private Declare Sub sendcommand Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal command$) 
    Private Declare Sub intloadimage Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal filename$, ByVal image_name$, ByVal image_type$) 
    Private Declare Sub extloadimage Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal filename$, ByVal image_name$, ByVal image_type$) 
    Private Declare Sub ecTextOut Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" (ByVal x%, ByVal y%, ByVal b%, ByVal c$, ByVal d$) 
    Private Declare Sub endjob Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" () 
    Private Declare Sub closeport Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" () 
    Private Declare Function isready% Lib "d:\gdx_cdsource\dll\sample\vb50\ezweb.dll" () 
    Private Sub command1_Click() 
    Call openport("Godex EZ-4206(web)") 
    Call beginjob (30, 5, 2, 1, 0, 0) 
    Call sendcommand("^W50") 
    Call sendcommand("^E23") 
    Call sendcommand("^P1") 
    Call sendcommand("^L") 
    Call sendcommand("AC,20,60,1,1,1,0,TEST") 
    Call ecTextOut(20, 10, 34, "細明體", "中文測試") 
    Call sendcommand("E") 
    Call endjob 
    Call closeport 
    End Sub 他在VB的例子
    能不能教我怎样声明函数????
      

  11.   

    声明过程为
    procedure openport(command: pchar);stdcall;external'EZWeb.dll'; 
    试一下
      

  12.   

     還沒解決啊?? 現在改成PCHAR後報什麼錯誤??
    procedure openport(var command:pchar);stdcall;external'EZWeb.dll'; 
    procedure closeport();stdcall;external'EZWeb.dll'; 
    帶上shareMem 單元後, 把執行的出錯信息貼出來
      

  13.   

    starluck...我已经加上shareMen单元了...仍然是出现同样的错
    我声明了函数...不在事件中使用就没问题...当加入
    procedure TfrmLabelPrinting.SeSkinButton8Click(Sender: TObject); 
    var 
    s:pchar; 
    begin 
      inherited; 
      s := '\\Wing\Godex EZ-1100 203dpi'; 
      openPort(s); 
      closePort(); 
    end; 
    异常就在系统一运行就提出来...
    The  application  failed  to  initialize  properly(0xc000007b).Click  on  OK  to  terminate  the  applicationProject testing.exe raised exception class EAccessViolation with message 'Access violation at address 00407156 in module' testing.exe'. Read of address 00000000'. Process stopped. Use Step or Run to Continue.
      

  14.   

    声明是没错...只是我从官网下载的DLL有问题...
    呵呵...
    问题已经解决了...谢谢STARLUCK的帮助