!请问,怎么再VC下创建多进程呢?

baojiabao2003 2005-08-23 04:01:21
小弟初学VC6,现在想做个多进程的程序,但是手头的书上都没有写怎么创建新的进程,有的只是CreatThread这样创建线程。请问各位高人,如何能在VC6下面创建新的进程呢?
...全文
299 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
dog0883 2005-09-07
  • 打赏
  • 举报
回复
The CreateProcess function creates a new process and its primary thread. The new process executes the specified executable file.

BOOL CreateProcess(
LPCTSTR lpApplicationName,
// pointer to name of executable module
LPTSTR lpCommandLine, // pointer to command line string
LPSECURITY_ATTRIBUTES lpProcessAttributes, // process security attributes
LPSECURITY_ATTRIBUTES lpThreadAttributes, // thread security attributes
BOOL bInheritHandles, // handle inheritance flag
DWORD dwCreationFlags, // creation flags
LPVOID lpEnvironment, // pointer to new environment block
LPCTSTR lpCurrentDirectory, // pointer to current directory name
LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO
LPPROCESS_INFORMATION lpProcessInformation // pointer to PROCESS_INFORMATION
);

------------------------------
The WinExec function runs the specified application.

This function is provided for compatibility with 16-bit Windows. Win32-based applications should use the CreateProcess function.

UINT WinExec(
LPCSTR lpCmdLine, // address of command line
UINT uCmdShow // window style for new application
);

进程是重量级的,用线程多好
oyljerry 2005-09-07
  • 打赏
  • 举报
回复
WinExec CreateProcess ShellExecute都可以,不过使用场合有点不同
weiym 2005-09-07
  • 打赏
  • 举报
回复
如果不需要该进程的句柄,用ShellExecute方便
feelmoon 2005-09-07
  • 打赏
  • 举报
回复
多线程,顾名思义就是多个线程,你用CreatThread创建多个线程,不就是多线程了么?
不同线程处理不同事务!!
wwwzhifeiji 2005-08-23
  • 打赏
  • 举报
回复
我也在学习相关知识,可以交流

QQ 21799439
baojiabao2003 2005-08-23
  • 打赏
  • 举报
回复
多谢各位,我试试看 :)
DentistryDoctor 2005-08-23
  • 打赏
  • 举报
回复
???????楼主????????
推荐两本
Win32多线程程序设计
Windows核心编程
jacky22098 2005-08-23
  • 打赏
  • 举报
回复
CreateProcess(),上MSDN查看这个函数的具体使用方法吧
i_noname 2005-08-23
  • 打赏
  • 举报
回复
CreateProcess

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧