快乐网维
2022-04-28 13:54
采纳率: 0%
浏览 47

delphi7 获取显示器相关信息遇到问题

用DELPHI7 编写一个显示器相关程序时遇到以下问题:

C++函数原型

_BOOL GetCapabilitiesStringLength(
[in] HANDLE hMonitor,
[out] LPDWORD pdwCapabilitiesStringLengthInCharacters
);

https://docs.microsoft.com/zh-tw/windows/win32/api/lowlevelmonitorconfigurationapi/nf-lowlevelmonitorconfigurationapi-getcapabilitiesstringlength

?%ra=link

我将此函数转换成Delphi如下

function GetCapabilitiesStringLength(hPhysicalMonitor: THandle; out pdwCapabilitiesStringLengthInCharacters: DWORD): BOOL; external 'Dxva2.dll';

一直无法返回True

C++

_BOOL CapabilitiesRequestAndCapabilitiesReply(
[in] HANDLE hMonitor,
[out] LPSTR pszASCIICapabilitiesString,
[in] DWORD dwCapabilitiesStringLengthInCharacters
);

https://docs.microsoft.com/zh-tw/windows/win32/api/lowlevelmonitorconfigurationapi/nf-lowlevelmonitorconfigurationapi-capabilitiesrequestandcapabilitiesreply
?%ra=link
我将此函数转换成delhpi

function CapabilitiesRequestAndCapabilitiesReply(const hMonitor: THandle; var pszASCIICapabilitiesString: PAnsiChar; const dwCapabilitiesStringLengthInCharacters: DWORD): BOOL; external 'Dxva2.dll';

由于上一个函数反法正确返回,所以这个函数也没法确定转换是否有问题

5条回答 默认 最新

相关推荐 更多相似问题