954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to call system calls in VC++?

Hello Everyone

Currently, I am using system("dir") method to call system calls.
I want to know any other method for system calls in VC++ 2008.
How can I call system call in VC++2008 without using system(" ") method?

Any help would be appreciated
Thanks

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

Never use system()
Just use kernel or user apis.

marco93
Junior Poster
132 posts since Apr 2008
Reputation Points: -76
Solved Threads: 14
 

Can you please give some examples of kernel or user APIs ?

how can i write system("dir") to kernel or user API level?

Thanks

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

ShellExecute is a Windows kernal api for doing what you are asking.

Each OS will have a different way of doing things so expect to use #ifdef/#endif pairs if cross-platform support is ever needed.

Celdecea
Newbie Poster
6 posts since Apr 2008
Reputation Points: 11
Solved Threads: 2
 

Thanks Celdecea

nav010
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

ShellExecute works similarly

krishnad
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You