Hi
Can anyone tell me how to create a process in VC++? I need to execute
regasm.exe testdll /tlb:test.tlb /codebase
command in that process.
Hi
Can anyone tell me how to create a process in VC++? I need to execute
regasm.exe testdll /tlb:test.tlb /codebase
command in that process.
You need to read up on CreateProcess() in msdn. There's sample code on that page.
If you just want to execute a synchronous command (run and wait), your best bet is to just use the system()
call (see here) to run it. Yes, I know it's a Linux page but C is a standard, no? :-)
For more fine-grained control of what gets run, how it runs (sync/async) and lots more options, CreateProcess()
(see here), and its brethren, are probably better, though you'll be tied to the Windows platform (which may not be of immediate concern to you).
Use CreateProcess() to spawn the process, check the return value to ensure that it started okay, then either close the handles to the process and the thread or use WaitForSingleObject() to wait until it finishes and then close handles.