开发者

System calls and Commands

How would you make system calls in a c++ program for windows, as the system() method allows for system commands, also what's the dif开发者_如何转开发ference between the two?

EDIT: I mean difference between system calls and system commands

EDIT: I have found that system commands are commands that you can run in cmd, you can also call these through the system() method, but I still don't know how to make system calls


This is a basic question. Find a tutorial online or a book. Also, MSDN has documentation on most of the Win32 functions.

#include <windows.h>
int main(int argc, char* argv[])
{
    MessageBox(NULL, "Hello, World", "My First Win32 Call", MB_OK);
    return 0;
}


If you mean the difference between calling a system function such as CopyFile through the Win API vs calling copy through system(), then by using the system function you can either statically or dynamically call the code that copies the file. By calling system() it spawns a separate process which calls the executable called copy and passes it parameters to copy the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜