How do I: Execute system operation call before compile project?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using Microsoft Visual C++ and i have some projects configuration.
(Configuration A, Configuration B, ..., Configuration N)

I need to execute some system operation call such as copy, delete, etc
before each
one project configuration compilation.

How do i do it?

Regards,
Jaime.
 
Jaime said:
I am using Microsoft Visual C++ and i have some projects configuration.
(Configuration A, Configuration B, ..., Configuration N)
OK.

I need to execute some system operation call such as copy, delete, etc
before each one project configuration compilation.

How do i do it?

Your options are described here:

http://msdn.microsoft.com/library/d...re/html/_asug_customizing_a_build_process.asp

If I understand you correctly, you want to use the "Pre-Build Event" feature
of the IDE.

Regards,
Will
 
William DePalo said:
In the workspace pane click on the name of your project. Then from the menu
choose Project->Settings. That displays a tabbed-dialog. Find the tab which
is labeled "Pre-Link Step":

http://msdn.microsoft.com/library/d...98/html/_asug_specify_prelink_build_rules.asp

OK!!!

But i like to do something tasks such as copy DOS command BEFORE compile
project process. Also, before resource compile process.

"Pre-Link" step is done before the link project process BUT after compile
project process.
"Post-build" step is done after the link project success.

Regards,
Jaime
 
Jaime said:
But i like to do something tasks such as copy DOS command BEFORE compile
project process. Also, before resource compile process.

"Pre-Link" step is done before the link project process BUT after compile
project process.
"Post-build" step is done after the link project success.

You're out of luck - upgrade to a new version ;-)

Either that, or use an external build-tool to run your builds, invoking
msdev with the appropriate build options to build the project from the
external tool.

-cd
 
Hi,
I want to write a program under VC++ which able to run an existing DOS file
either open a DOS prompt window and I manually enter commands, or program
itself retrieve the DOS file and run it. Just I need to know it is possible
under VC++ and how?

Thanks in advance.

ASH
 
Ash Homain said:
I want to write a program under VC++ which able to run an existing DOS
file
either open a DOS prompt window and I manually enter commands, or program
itself retrieve the DOS file and run it. Just I need to know it is
possible
under VC++ and how?

What you do is start a process which runs a command interpreter. On
NT/2K/XP/2K+3, the default command shell is "cmd.exe". Otherwise it is
"command.com". I mention that only because you used "DOS" several times in
your question.

In any event, once you know the command interpreter you want to run, you
start it in any number of ways - _spawn..., _exec..., ShellExecute(),
CreateProcess(), WinExec() etc

Regards,
Will
 
Thanks for your comments. Actually, I wrote a program in VC++ that produces a
number of data. I need to process those data in a program, which is run under
DOS environmental. Then I need to return outputs in my program and continue
for post processing. When data are more than a thousand it will be very
tedious job. I am thinking probably it is possible to make a link between my
program and DOS-Based program to speed up it. If you have any comment please
share with me.


Regards

ASH
 
Ash Homain said:
Thanks for your comments.

You are welcome.
Actually, I wrote a program in VC++ that produces a
number of data. I need to process those data in a
program, which is run under DOS environmental. Then
I need to return outputs in my program and continue
for post processing. When data are more than a thousand
it will be very tedious job. I am thinking probably it is possible
to make a link between my program and DOS-Based program
to speed up it.

Read the article "HOWTO: Spawn Console Processes with Redirected Standard
Handles" here

http://support.microsoft.com/?id=190351
If you have any comment please
share with me.

People use the method that the article describes all the time. I'm not a big
fan of it. It is a brittle hack. I'd search for a better solution.

Regards,
Will
 
Back
Top