引用DLL的有关问题
引用DLL的问题
HRESULT _stdcall SetCursorPos([in] int iCursorPosX, [in] int iCursorPosY );
返回类型是HRESULT
这个DLL函数怎么在DELPHI里申明?
------解决方案--------------------
应该这样声明:
function SetCursorPos(iCursorPosX, iCursorPosY :integer):HRESULT;
implementation
function SetCursorPos; external '*.dll ' name '_stdcall SetCursorPos ';
我以前也遇到这样的问题的了,就是这样处理的
------解决方案--------------------
function SetCursorPos(X, Y: Integer): BOOL; stdcall;在d里这个函数可以直接调用,不用声明
------解决方案--------------------
C++:
typedef LONG HRESULT;
HRESULT _stdcall SetCursorPos([in] int iCursorPosX, [in] int iCursorPosY );
Delphi:
function SetCursorPos(iCursorPosX, iCursorPosY:integer ):integer;stdcall;
HRESULT _stdcall SetCursorPos([in] int iCursorPosX, [in] int iCursorPosY );
返回类型是HRESULT
这个DLL函数怎么在DELPHI里申明?
------解决方案--------------------
应该这样声明:
function SetCursorPos(iCursorPosX, iCursorPosY :integer):HRESULT;
implementation
function SetCursorPos; external '*.dll ' name '_stdcall SetCursorPos ';
我以前也遇到这样的问题的了,就是这样处理的
------解决方案--------------------
function SetCursorPos(X, Y: Integer): BOOL; stdcall;在d里这个函数可以直接调用,不用声明
------解决方案--------------------
C++:
typedef LONG HRESULT;
HRESULT _stdcall SetCursorPos([in] int iCursorPosX, [in] int iCursorPosY );
Delphi:
function SetCursorPos(iCursorPosX, iCursorPosY:integer ):integer;stdcall;