L
linzhengqqun
Unregistered / Unconfirmed
GUEST, unregistred user!
C中对于CreateProcess的声明如下
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
而Delphi中的声明是这样的:
function CreateProcess(
lpApplicationName: PChar;
lpCommandLine: PChar;
lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
bInheritHandles: BOOL;
dwCreationFlags: DWORD;
lpEnvironment: Pointer;
lpCurrentDirectory: PChar;
const lpStartupInfo: TStartupInfo;
var lpProcessInformation: TProcessInformation
): BOOL; stdcall;
各位看看LPSTARTUPINFO lpStartupInfo,是一个指针,
而const lpStartupInfo: TStartupInfo;是一个常量的实参
这让我很迷惑,各位高手能不能讲讲是为什么
顺便谈谈复杂API用Delphi来声明的一些技巧啊。
BOOL CreateProcess(
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
而Delphi中的声明是这样的:
function CreateProcess(
lpApplicationName: PChar;
lpCommandLine: PChar;
lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
bInheritHandles: BOOL;
dwCreationFlags: DWORD;
lpEnvironment: Pointer;
lpCurrentDirectory: PChar;
const lpStartupInfo: TStartupInfo;
var lpProcessInformation: TProcessInformation
): BOOL; stdcall;
各位看看LPSTARTUPINFO lpStartupInfo,是一个指针,
而const lpStartupInfo: TStartupInfo;是一个常量的实参
这让我很迷惑,各位高手能不能讲讲是为什么
顺便谈谈复杂API用Delphi来声明的一些技巧啊。