HRESULT _stdcall SetCursorPos([in] int iCursorPosX, [in] int iCursorPosY );返回类型是HRESULT
这个DLL函数怎么在DELPHI里申明?

解决方案 »

  1.   


    应该这样声明: function SetCursorPos(iCursorPosX, iCursorPosY :integer):HRESULT;implementation function SetCursorPos; external '*.dll' name '_stdcall SetCursorPos';  我以前也遇到这样的问题的了,就是这样处理的
      

  2.   

    返回值 HRESULT 怎么处理?
      

  3.   

    不行,你这里是静态调用。我在type里写了
    [23]  function SetCursorPos(iCursorPosX, iCursorPosY :integer):HRESULT;
    在implementation里写了
    [29]  function SetCursorPos; external 'xxxx.dll' name '_stdcall SetCursorPos';提示
    (23)Unsatisfied forward or external declaration: 'SetCursorPos'
    (29)Previous declaration of 'SetCursorPos' was not ed with the 'overload' directive
      

  4.   


    "返回值 HRESULT 怎么处理?"
    不明白你返回的是什么数据类型?
    如果是bool,就是
     if SetCursorPos then
       ...
     else
       ...还有'xxxx.dll' ,这里是你的外面动态库名称
      

  5.   

    function SetCursorPos(X, Y: Integer): BOOL; stdcall;在d里这个函数可以直接调用,不用声明
      

  6.   


    C++:
    typedef LONG HRESULT;
    HRESULT _stdcall SetCursorPos([in] int iCursorPosX, [in] int iCursorPosY );
    Delphi:
      function SetCursorPos(iCursorPosX, iCursorPosY:integer ):integer;stdcall;
      

  7.   

    setcursorpos是系统已经申明的函数喔
      

  8.   

    弱弱的问问:HRESULT 是啥数据类型啊?
      

  9.   

    是整型吧
    上面都说是integer了 啊?