Can anyone list the specific and detailed steps to configure mc.exe (the message compiler) to compile a .mc file into a .rc file as a custom compiler step in VC++ 2010?
I am really lost on how to do this.
Used to compile instrumentation manifests and message text files. The compiler generates the message resource files to which your application links. syntax Copy.
An MC file is a 3D model created by Molecular Constructor, a free molecule building program. It is a plain text file that specifies atoms' positions and bonds within a molecule and, when loaded in Molecular Constructor, is used to show the molecule in 3D.
Hans Passant almost had it right. Unfortunately, $(InputPath) and $(InputName) aren't defined in VS 2010. Instead, create your message file:
#include "messages.rc"
That file will be generated by the message compiler. Now add a custom build step to run the message compiler:
Set the "Command Line" property to:
mc %(FullPath)
Set the Description property to something like "Compiling Messages..."
%(Filename).rc;%(Filename).h;MSG0409.bin
The file MSG00409.bin is from having the following line in messages.mc:
LanguageNames = (English=0x409:MSG00409)
There can be a bin file for each language you add to messages.mc. The nice part of listing them in the output is that it will be deleted when the project is cleaned.
The only thing I'm not sure about is setting the "Execute Before" property to guarantee messages.rc is generated before resource.rc is compiled. I didn't have to set it, but if you find the resource compiler is trying to execute before the message compiler, then you'll have to set this property. It's disabled for the "messages.mc" file, but it can be set in the project's "Custom Build Step" property.
Right-click the project, Add + New Item, select Text File, name it Blah.mc. Enter or paste the definitions. Right-click Blah.mc, Properties, Custom build step:
Edit your .rc file, add:
#include "Blah.rc"
Worked for me, ought to be close.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With