如果不使用CreateProcess函数,是否可以替代系统调用? [英] Is there any alternative to system calls without using CreateProcess function?

查看:93
本文介绍了如果不使用CreateProcess函数,是否可以替代系统调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Visual Studio(C ++)的新手.
我可以在不使用MFC的情况下编写普通的C ++程序吗,可以在不使用CreateProcess函数的情况下调用系统调用(这对我来说很困难).

I am new to Visual Studio (C++).
Can I write normal C++ program without using MFC, can I call system calls without using CreateProcess function (that is very difficult for me).
Can you please give the way?

推荐答案

这个问题没有任何意义.使用CreateProcess不是系统调用.您本身调用了此方法,这是一个系统调用,但是此调用的结果是某些进程的执行,而该进程不是系统调用.系统调用基本上是通过将系统DLL链接到您的应用程序并从这些DLL调用方法来使用的.实际上,它发生在每个程序中,否则它不会像结果输出那样产生任何影响.

—SA
The question does not make any sense. Using CreateProcess is not a system call. You call this method itself, and this is a system call, but the result of this call is execution of some process, and this process is not a system call. System calls are basically used by linking system DLLs to your application and calling methods from these DLLs. It actually happens in each and every program, otherwise it could not have any effect like output of the results.

—SA


在Visual Studio中创建新的C ++项目时,您会看到可以创建的许多不同类型.
只有那些使用MFC的名称才能使用它.
其他类型则没有.
因此绝对可以在不使用MFC的情况下编写程序.
MFC简化了许多任务,仅此而已.

CreateProcess是一个API,可帮助您从正在执行的进程中创建一个新进程.
它与UNIX中的fork()非常相似.
您不必调用此API.
When you create a new C++ project in Visual Studio you can see many different kinds that you can create.
Only those names as using MFC uses it.
Other types do not.
So it is definitely possible to write programs without using MFC.
MFC simplifies many tasks, that''s all.

CreateProcess is an API that helps to create a new process from withing your executing process.
It is very similar to fork() in unix.
There is no mandate that you have to call this API.


您可以使用 ^ ]函数.
You can use one of these[^] functions.


这篇关于如果不使用CreateProcess函数,是否可以替代系统调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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