$dw = new COM("DynamicWrapper"); 
$dw->Register("EbUsbApi.dll", "EbCreateDataFile", 'i=sls', "f=s", "r=l"); 想问一下,这里的'i=sls', "f=s", "r=l"是什么意思
我是PHP小白,因为最近有个项目要用到PHP调用dll,正在学习。
这段是我看到一篇总结PHP调用dll经验的文章里的。链接如下:
http://blog.csdn.net/hn3e21/article/details/6074847 求大神答疑解惑 感谢

解决方案 »

  1.   

    描述如下
    i=describes the number and data type of the functions parametersf=type of call _stdcall or _cdecl. So it can work with both MS C++ and Borland C++. Default to _stdcall. If that doesn't work use _cdecl. If that doesn't work good luck!r=return data type.Data types are:const ARGTYPEINFO ArgInfo[] = 
    {
    {'a', sizeof(IDispatch*), VT_DISPATCH}, // a IDispatch*
    {'c', sizeof(unsigned char), VT_I4}, // c signed char 
    {'d', sizeof(double), VT_R8}, // d 8 byte real 
    {'f', sizeof(float), VT_R4}, // f 4 byte real 
    {'k', sizeof(IUnknown*), VT_UNKNOWN}, // k IUnknown* 
    {'h', sizeof(long), VT_I4}, // h HANDLE 
    {'l', sizeof(long), VT_I4}, // l long 
    {'p', sizeof(void*), VT_PTR}, // p pointer 
    {'s', sizeof(BSTR), VT_LPSTR}, // s string 
    {'t', sizeof(short), VT_I2}, // t short 
    {'u', sizeof(UINT), VT_UINT}, // u unsigned int 
    {'w', sizeof(BSTR), VT_LPWSTR}, // w wide string 
    }
      

  2.   


    谢谢!我这还有个问题,
    我写了一段代码,运行的时候为什么会出现下面的错误啊。
    Fatal error: Call to undefined function newCOM() newCOM这个函数要怎么用涉及到调用dll的代码是这样<?php
    $dw=newCOM("DynamicWrapper");
    $dw->Register("sDLL.dll","plus","f=s","i=ll","r=l");
    $no3=plus(2,2);
    ?>
      

  3.   

    PHP调用dll的功能,这个扩展的支持不积极,虽然也不怎么需要更新,但是好像不更新了。这个功能是个比较边缘的功能。还是你应该自己查查这个扩展的资料吧。编译问题不一定都很好办。
      

  4.   

    这么懒?连空格都不愿打?
    $dw = new COM("DynamicWrapper");
      

  5.   


    打了空格就会提示 class 未定义 
      

  6.   

    com 类只能用于 windows 系统的 php
    如果你的 php 版本大于 5.3 还需要加载对应扩展
    php.ini
    extension=php_com_dotnet.dll
      

  7.   


    哦哦 这样啊 谢谢不过 为什么运行起来又会报其他错误呢错误如下: Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `DynamicWrapper.dll' 
      

  8.   

    DynamicWrapper.dll 没有注册或注册不成功
      

  9.   

    不是可以用dl()来动态调用dll吗
      

  10.   


    现在报的错是这个了 message后面没有话了  知道怎么回事么
    Fatal error: Uncaught exception 'com_exception' with message '
      

  11.   


    php5 之后dl()已经被废了 不可以了
      

  12.   

    你 DynamicWrapper.dll 是什么版本的?
    现在报的错是这个了 message后面没有话了  知道怎么回事么
    Fatal error: Uncaught exception 'com_exception' with message '