Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?
Posted
Updated 20-Oct-10 21:09pm
v2
Comments
The Manoj Kumar 21-Oct-10 1:58am    
Which programming language are you using C++, C# or VB.Net?
satyapannala 21-Oct-10 2:48am    
visual studio c++

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
 
Share this answer
 
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.
 
Share this answer
 
Comments
satyapannala 21-Oct-10 6:48am    
can i use shell execute method()
«_Superman_» 22-Oct-10 1:52am    
If you want to start another process from within your process you can use CreateProcess or ShellExecute or ShellExecuteEx or system.
You can use one of these[^] functions.
 
Share this answer
 
SHELLEXECUTEINFOW execInfo;
ZeroMemory(&execInfo, sizeof(execInfo));
execInfo.cbSize = sizeof(execInfo);
execInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
execInfo.nShow = SW_SHOWNORMAL;
execInfo.lpFile = L"test.exe";
ShellExecuteEx(&execInfo);
 
Share this answer
 
v3
I stopped using MFC a few years ago and am happy about it. Answer #3 is good. If you are interesting in multi-threading you can use CreateThread, C++/CLI, or a number of multi-threading libraries.
 
Share this answer
 
Comments
Rajesh R Subramanian 15-Dec-10 2:01am    
You should NEVER use CreateThread(), and C++/CLI has nothing to do in this context.
T2102 15-Dec-10 6:35am    
.NET (e.g. C++/CLI and C#) have multi-threading options and the ability to create processes and threads with relative ease, although using managed code has a performance hit...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900