如何在Delphi Prism中调用函数CreateProcess? [英] How to call function CreateProcess in Delphi Prism?

查看:118
本文介绍了如何在Delphi Prism中调用函数CreateProcess?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了

function CreateProcess(
            lpApplicationName:String;
            lpCommandLine:String;
            lpProcessAttributes:IntPtr;
            lpThreadAttributes:IntPtr;
            bInheritHandles:Boolean;
            dwCreationFlags:Int32;
            lpEnvironment:IntPtr;
            lpCurrentDirectory:IntPtr;
            lpStartupInfo:STARTUPINFO;
            lpProcessInformation:ProcessInfo):Boolean;
         external 'kernel32.dll';

但是VStudio说"Semicolon"是预期的-在外部之后,"kernel32.dll"之后是结束"; 您能帮我加载和调用函数吗?

but VStudio said "Semicolon" expected - after external and " "end" expected" after 'kernel32.dll'; Can you help me to load and call a function please?

推荐答案

为什么不使用.NET Process Class ..在这种情况下,使用interop并没有多大意义,因为您已经在使用Delphi棱镜..

Why don't you use the .NET Process Class .. it does not make a lot of sense to use interop in this case since you are already using Delphi Prism..

http://msdn.microsoft.com/en -us/library/system.diagnostics.process.aspx

这篇关于如何在Delphi Prism中调用函数CreateProcess?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆