6

I am trying to use the mc.exe to make message files for my event log writing program. But even the sample message file provided by the Microsoft won't compile. Who knows how to write a message file that could be compiled by mc.exe?

EDIT: The error message I got is :

msgs.mc(1) : error : expected keyword
- ??

Edit 2: Problem solved. The mc.exe can only support Unicode or ANSI encoded source file. My file is encoded as UTF8. That's it.

Thanks.

Duncan Smart
  • 31,172
  • 10
  • 68
  • 70
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • Please close this case since I have solved it. Thanks, dear moderator. – smwikipedia Jul 27 '10 at 06:31
  • Yeah, questions don't get closed when the problem is solved, they get answered. And then they stay open forever, still marked as answered so that others can see the problem and the solution. That's how the site works. Just letting you know. – Task Feb 15 '13 at 19:34

3 Answers3

6

Always document the error message you get

Being forced to guess: if you get an error in line #82, complaining about an invalid character (0x2e), then open the file in a text editor, put the cursor after the . and press Enter so the line is terminated with a line feed.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • I wish I could upvote this a million times. This has got to be the worst documented tool MS has ever come up with. SO to the rescue again. – Pow-Ian Jun 18 '19 at 17:36
6

Problem solved. The mc.exe can only support Unicode or ANSI encoded source file. My file is encoded as UTF8. That's it.

Thanks guys.

smwikipedia
  • 61,609
  • 92
  • 309
  • 482
2

The sample works for me in Visual Studio 2008 or 2010. How about posting your msgs.mc file.

Also did you save as plain ascii? Maybe the encoding header is confusing it...

ngoozeff
  • 4,576
  • 3
  • 28
  • 21