问题描述
- 如果将 C 的 struct 转为 Delphi Record
- 请教如何将下面的联合转为记录的一部分啊?坐等了,多谢。
typedef struct _IP_ADAPTER_ADDRESSES {
union {
ULONGLONG Alignment;
struct {
ULONG Length;
DWORD IfIndex; };
};
struct _IP_ADAPTER_ADDRESSES* Next;
PCHAR AdapterName;
PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
...
} ...
解决方案
TKEYDATA = record Press: Integer; Code: Integer;end;VK_SENDKEY = record Count: Integer; Keys: array[0..5] of TKEYDATA;end;PVK_SENDKEY = ^VK_SENDKEY;追问可否再帮我一下,我会再多加分的。。。void CTestDlg::OnButton1() { VK_SENDKEY data; memset(&data0sizeof(data)); data.Count = 1; data.Keys[0].Code = 0x24; data.Keys[0].Press = true; VKSendKeyEx(hkey&data);}我用Delphi硬是搞不好,出错。。。。
时间: 2024-12-03 05:22:25