我正在使用 QB64 编程,这是一种允许类似 QBASIC 的语法的编程语言,并被翻译成 C++ 代码并编译。
如果我们想struct
在我们的代码中使用 a,那么我们必须声明它并手动创建它。在 32 位中,没问题,因为它与 WinAPI MSDN 页面匹配并且几乎总是可以工作。然而,对于 64 位,结构具有不同的字节打包,我无法确定STARTUPINFO struct
.
下面是我对struct
32 位工作的声明。我知道struct
需要 104 个字节,我目前短 8 个字节;我已确保我的所有变量都与 64 位大小匹配,但我在结构中的某处缺少 8 个字节的填充。知道字节打包和 WinAPI 结构的人可以帮我解决这个问题吗?
Type STARTUPINFO
cb As Long '4 bytes
lpReserved As _Offset '4 bytes in 32, 8 in 64
lpDesktop As _Offset '4 bytes in 32, 8 in 64
lpTitle As _Offset '4 bytes in 32, 8 in 64
dwX As Long '4 bytes
dwY As Long '4 bytes
dwXSize As Long '4 bytes
dwYSize As Long '4 bytes
dwXCountChars As Long '4 bytes
dwYCountChars As Long '4 bytes
dwFillAttribute As Long '4 bytes
dwFlags As Long '4 bytes
wShowWindow As Integer '2 bytes
cbReserved2 As Integer '2 bytes
lpReserved2 As _Offset '4 bytes in 32, 8 in 64
hStdInput As _Offset '4 bytes in 32, 8 in 64
hStdOutput As _Offset '4 bytes in 32, 8 in 64
hStdError As _Offset '4 bytes in 32, 8 in 64
End Type