C中的函数声明是这样的DAQmxReadCounterScalarU32 (TaskHandle taskHandle, float64 timeout, uInt32 *value, bool32 *reserved);DELPHI中 function DAQmxReadCounterScalarU32(AtaskHandle:TaskHandle;TimeOut:Double;Value:PBool32;Reserved:Pbool32):Integer;stdcall;external 'nicaiu.dll'
 bool32=Cardinal ;
 PBool32=^bool32 ;
上述这样声明以后,老是提示'Invalid pointer operation',很痛苦不知道怎么办,我后来把Cardinal指针类型改为PInteger类型,也不可以

解决方案 »

  1.   

    try this way
    function DAQmxReadCounterScalarU32(AtaskHandle:TaskHandle; TimeOut:Double;var Value:Cardinal;var Reserved:Bool):Integer; stdcall; external 'nicaiu.dll'
      

  2.   


    不行啊,报引用另外一个DLL错误,Access violation
      

  3.   

    DAQmxReadCounterScalarU32 
    定义是什么? 
    估计有可能是调用约定没写对
      

  4.   

    http://blog.csdn.net/derryzhang/archive/2009/08/05/4412436.aspx
    不知道这个方法楼主试了没。
      

  5.   


    Seems calling convention is different from stdcall. Can you elaborate more how and using what convention this method is exported in C ?Another thing I would have tried is removing the stdcall convention from delphi declaration. Or would have gone with Explicit Linking option.//Ali