我在做一个程序,用到了一个dll,但是软件给的demo是 vb 写的,不知道怎么翻译成 delphivb \代码如下:
 public declare sub openport lib "ezweb.dll" (byval command$)
 public declare sub closeport lib "ezweb.dll"()
 public declare sub beginjob lib "ezweb.dll" (byval a%,byval b%,byval c%) $在vb里是宏,delphi 有 宏吗?a%又是什么意思呢?帮忙呀!!!!

解决方案 »

  1.   

    和delphi里引用dll文件格式是一样的吧
      

  2.   

    Delphi中没有宏,但是宏的意思是简化代码编写量可以直接将宏的内容写到需要用宏的地方。
    %的意思请到VB版问问,这个不知。
    Delphi中预定义函数的方式参考下面:
    Static loading
    The simplest way to import a procedure or function is to declare it using the external directive. For example,
    On Windows:procedure DoSomething; external 'MYLIB.DLL';
    On Linux:  procedure DoSomething; external 'mylib.so';
      

  3.   

    public declare sub openport lib "ezweb.dll" (byval command$)
    public declare sub beginjob lib "ezweb.dll" (byval a%,byval b%,byval c%)这里的$和%不是宏,是VB的数据类型,$表示字符串,,%表示整型。
      

  4.   

    public declare sub openport lib "ezweb.dll" (byval command$)  相当于:
    public declare sub openport lib "ezweb.dll" (byval command  As String)public declare sub beginjob lib "ezweb.dll" (byval a%,byval b%,byval c%)  相当于:
    public declare sub beginjob lib "ezweb.dll" (byval a As Integer,byval b As Integer,byval c As Integer)
      

  5.   

    $不是宏,是串型类型,%是整型类型!
    将EZWEB.DLL COPY到应用程序的文件夹下(或SYSTEM32下)
    public declare sub openport lib "ezweb.dll" (byval command$)
    翻译成:
    procedure OpenPort(Command : string) ; external 'ezWeb.dll';
    余类推...
      

  6.   

    longtusoft(神灯之主) 的觀點
      

  7.   

    我也象 longtusoft(神灯之主) 说的做了,但是没效果。是不是和dll文件有关??