Posting events to the event viewer.

I've been using a particular method to post program events to the event 
viewer. It works, but there is an issue that is driving me crazy. Perhaps 
there is a better way or different way to accomplish what I am doing.

1) My events are listed in a file I call EventLog.mc. The events are in this 
file using a particular syntax.

2) Right after creating the file for the first time, or if I change the 
file, I run the event log compiler. by doing "mc.exe EventLog -d". This 
process creates a file called "EventLog.rc".

3) I directly edit my program's main .rc file. Near the top of this file I 
insert the a line:
#include "EventLog.rc"

4) That is all that I do. When I compile my project everything works great.


Unfortunately there is a goofy problem that is driving me nuts.

If I edit any dialog or anything else in my resource file, the next time I 
compile the program I will get a goofy error while compiling the resources. 
It says: error RC2135 : file not found: BEGIN

I correct this problem by directly opening my program's resource file. The 
file will now contain a large block of hex numbers labeled "11"  with the 
first data line being "1 11 MOVEABLE PURE" To correct my problem I delete 
this block of data and insert a line that says: #include "EventLog.rc" Then 
I close the file.

Then I recompile and everything works.


Stuff is technically working, but having to constantly deal with this error, 
is driving me nuts. Is there a different and better way?





0
paco_beams (39)
10/16/2007 3:54:02 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
875 Views

Similar Articles

[PageSpeed] 23

See below...
On Tue, 16 Oct 2007 03:54:02 GMT, "Paco" <paco_beams@gmail.com> wrote:

>I've been using a particular method to post program events to the event 
>viewer. It works, but there is an issue that is driving me crazy. Perhaps 
>there is a better way or different way to accomplish what I am doing.
>
>1) My events are listed in a file I call EventLog.mc. The events are in this 
>file using a particular syntax.
****
I presume by "particular syntax" you mean either (a) it is the standard syntax of the .mc
file or (b) there is a canonical form of the text you are using.
****
>
>2) Right after creating the file for the first time, or if I change the 
>file, I run the event log compiler. by doing "mc.exe EventLog -d". This 
>process creates a file called "EventLog.rc".
*****
Actually, it creates a bunch of other files, notably files with names like msg000001.bin.

By the way, you can make that a custom job step in your build so you don't have to run it
by hand.
****
>
>3) I directly edit my program's main .rc file. Near the top of this file I 
>insert the a line:
>#include "EventLog.rc"
****
This is where your problem is.  You have to first click on the "Resource View" tab, then
look at the "Edit" menu, and find the "Resource Includes..." item.  You will get a dialog
box, and in the top one ("Read only symbol directives") put your #include request.  The
point is you don't want this included in the .rc file (which is what happened to you), you
want the compilation of the .rc file to include it.  This is a subtle point, but a
critical one.  
****
>
>4) That is all that I do. When I compile my project everything works great.
>
>
>Unfortunately there is a goofy problem that is driving me nuts.
>
>If I edit any dialog or anything else in my resource file, the next time I 
>compile the program I will get a goofy error while compiling the resources. 
>It says: error RC2135 : file not found: BEGIN
>
>I correct this problem by directly opening my program's resource file. The 
>file will now contain a large block of hex numbers labeled "11"  with the 
>first data line being "1 11 MOVEABLE PURE" To correct my problem I delete 
>this block of data and insert a line that says: #include "EventLog.rc" Then 
>I close the file.
*****
It is counterintuitive, but this is actually what it is supposed to do.  I know it is
weird, but a #include found in a .rc file does the #include as the .rc file is being
loaded.  But if you add it as described above, it defers the #include to the rc compiler
phase.  Take a look at the resulting .rc file after you've done that, and you will see
what is going on.
				joe
***** 
>
>Then I recompile and everything works.
>
>
>Stuff is technically working, but having to constantly deal with this error, 
>is driving me nuts. Is there a different and better way?
>
>
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
10/16/2007 12:30:18 PM
Thank you... It works great.


"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message 
news:1ua9h3d1hp1ciob55dtb39adi7dm13824m@4ax.com...
> See below...
> On Tue, 16 Oct 2007 03:54:02 GMT, "Paco" <paco_beams@gmail.com> wrote:
>
>>I've been using a particular method to post program events to the event
>>viewer. It works, but there is an issue that is driving me crazy. Perhaps
>>there is a better way or different way to accomplish what I am doing.
>>
>>1) My events are listed in a file I call EventLog.mc. The events are in 
>>this
>>file using a particular syntax.
> ****
> I presume by "particular syntax" you mean either (a) it is the standard 
> syntax of the .mc
> file or (b) there is a canonical form of the text you are using.
> ****
>>
>>2) Right after creating the file for the first time, or if I change the
>>file, I run the event log compiler. by doing "mc.exe EventLog -d". This
>>process creates a file called "EventLog.rc".
> *****
> Actually, it creates a bunch of other files, notably files with names like 
> msg000001.bin.
>
> By the way, you can make that a custom job step in your build so you don't 
> have to run it
> by hand.
> ****
>>
>>3) I directly edit my program's main .rc file. Near the top of this file I
>>insert the a line:
>>#include "EventLog.rc"
> ****
> This is where your problem is.  You have to first click on the "Resource 
> View" tab, then
> look at the "Edit" menu, and find the "Resource Includes..." item.  You 
> will get a dialog
> box, and in the top one ("Read only symbol directives") put your #include 
> request.  The
> point is you don't want this included in the .rc file (which is what 
> happened to you), you
> want the compilation of the .rc file to include it.  This is a subtle 
> point, but a
> critical one.
> ****
>>
>>4) That is all that I do. When I compile my project everything works 
>>great.
>>
>>
>>Unfortunately there is a goofy problem that is driving me nuts.
>>
>>If I edit any dialog or anything else in my resource file, the next time I
>>compile the program I will get a goofy error while compiling the 
>>resources.
>>It says: error RC2135 : file not found: BEGIN
>>
>>I correct this problem by directly opening my program's resource file. The
>>file will now contain a large block of hex numbers labeled "11"  with the
>>first data line being "1 11 MOVEABLE PURE" To correct my problem I delete
>>this block of data and insert a line that says: #include "EventLog.rc" 
>>Then
>>I close the file.
> *****
> It is counterintuitive, but this is actually what it is supposed to do.  I 
> know it is
> weird, but a #include found in a .rc file does the #include as the .rc 
> file is being
> loaded.  But if you add it as described above, it defers the #include to 
> the rc compiler
> phase.  Take a look at the resulting .rc file after you've done that, and 
> you will see
> what is going on.
> joe
> *****
>>
>>Then I recompile and everything works.
>>
>>
>>Stuff is technically working, but having to constantly deal with this 
>>error,
>>is driving me nuts. Is there a different and better way?
>>
>>
>>
>>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm 


0
paco_beams (39)
10/16/2007 1:11:51 PM
In article <uBWQi.9846$lD6.1593@newssvr27.news.prodigy.net>, "Paco" <paco_beams@gmail.com> wrote:
>I've been using a particular method to post program events to the event 
>viewer. It works, but there is an issue that is driving me crazy. Perhaps 
>there is a better way or different way to accomplish what I am doing.
>
>1) My events are listed in a file I call EventLog.mc. The events are in this 
>file using a particular syntax.
>
>2) Right after creating the file for the first time, or if I change the 
>file, I run the event log compiler. by doing "mc.exe EventLog -d". This 
>process creates a file called "EventLog.rc".
>
>3) I directly edit my program's main .rc file. Near the top of this file I 
>insert the a line:
>#include "EventLog.rc"
>
>4) That is all that I do. When I compile my project everything works great.
>
>
>Unfortunately there is a goofy problem that is driving me nuts.
>
>If I edit any dialog or anything else in my resource file, the next time I 
>compile the program I will get a goofy error while compiling the resources. 
>It says: error RC2135 : file not found: BEGIN
>
>I correct this problem by directly opening my program's resource file. The 
>file will now contain a large block of hex numbers labeled "11"  with the 
>first data line being "1 11 MOVEABLE PURE" To correct my problem I delete 
>this block of data and insert a line that says: #include "EventLog.rc" Then 
>I close the file.
>
>Then I recompile and everything works.

>Stuff is technically working, but having to constantly deal with this error, 
>is driving me nuts. Is there a different and better way?

Your whole approach is wrong.
You'll be wasting time and it'll never work.

--
The most powerful tool for usenet you have ever heard of.

NewsMaestro v. 4.0.1 Hail Democracy Release has been released.

Important feature additions and various improvements
and optimizations.

Web page:

http://newsmaestro.sourceforge.net/

NewsMaestro download page:

http://newsmaestro.sourceforge.net/Download_Information.htm

0
almond1 (17)
10/17/2007 12:06:07 AM
Actually, only one tiny detail was wrong, and fixing that makes it work.  I see nothing
wrong with this approach, which is what is supported by the Event Viewer, and other than a
minor change to how the #include is specified, he's doing everything right.  The only
other thing he needs to do to make it really smooth is make the mc a job step in the
build.
				joe

On Wed, 17 Oct 2007 00:06:07 GMT, almond@brothers.orgy (Almond) wrote:

>In article <uBWQi.9846$lD6.1593@newssvr27.news.prodigy.net>, "Paco" <paco_beams@gmail.com> wrote:
>>I've been using a particular method to post program events to the event 
>>viewer. It works, but there is an issue that is driving me crazy. Perhaps 
>>there is a better way or different way to accomplish what I am doing.
>>
>>1) My events are listed in a file I call EventLog.mc. The events are in this 
>>file using a particular syntax.
>>
>>2) Right after creating the file for the first time, or if I change the 
>>file, I run the event log compiler. by doing "mc.exe EventLog -d". This 
>>process creates a file called "EventLog.rc".
>>
>>3) I directly edit my program's main .rc file. Near the top of this file I 
>>insert the a line:
>>#include "EventLog.rc"
>>
>>4) That is all that I do. When I compile my project everything works great.
>>
>>
>>Unfortunately there is a goofy problem that is driving me nuts.
>>
>>If I edit any dialog or anything else in my resource file, the next time I 
>>compile the program I will get a goofy error while compiling the resources. 
>>It says: error RC2135 : file not found: BEGIN
>>
>>I correct this problem by directly opening my program's resource file. The 
>>file will now contain a large block of hex numbers labeled "11"  with the 
>>first data line being "1 11 MOVEABLE PURE" To correct my problem I delete 
>>this block of data and insert a line that says: #include "EventLog.rc" Then 
>>I close the file.
>>
>>Then I recompile and everything works.
>
>>Stuff is technically working, but having to constantly deal with this error, 
>>is driving me nuts. Is there a different and better way?
>
>Your whole approach is wrong.
>You'll be wasting time and it'll never work.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
10/17/2007 3:56:20 AM
Reply:

Similar Artilces:

FileSystemWatcher won't fire for directory events
I trying to be notified when a directory is created, deleted, renamed or moved. What am I doing wrong? moFolderSysWatch = New FileSystemWatcher(m_WatchDirectory, "") moFolderSysWatch.IncludeSubdirectories = True moFolderSysWatch.NotifyFilter = NotifyFilters.DirectoryName moFolderSysWatch.EnableRaisingEvents = True Am 05.03.2010 19:13, schrieb Mike Beebe: > I trying to be notified when a directory is created, deleted, renamed or > moved. What am I doing wrong? > > moFolderSysWatch = New FileSystemWatcher(m_WatchDir...

Posting old bills
I am setting up Money 2006 to tract income and expenses for a rental property, but I need to back date it to 1/1/2007. How do I enter bills and deposits made in the past? Thanks Go to the account register and enter the manually. Just click on the next blank transaction and go to town. You may want to make sure you are using Advanced Register. If there are subsequent transactions already in these accounts and you have balanced the accounts to statements--as though these transactions were already entered--then you will have to adjust account beginning balances and/or Account Adjustment...

* OWA... (Third Post)
Microsoft? If you're concerned about security then you should respond to this question. We cannot make this OWA server available on the Internet without applying the latest SP and critical updates. =========================== Our OWA Exchange 5.5 server (Windows NT Server) recently died and we replaced it with a Windows 2000 Server. We installed Exchange 5.5 OWA then applied Exchange SP4. Everything was working until we apply Windows 2000 SP4. Everytime we logon we get "OWA was unable to get to your inbox" error. As soon as we un-installed Windows 2000 SP4, OWA wo...

To the sender of the MI5 posts
I am not sure if you read responses or (like most other spammers) just see the web as a place where you are free to say whatever you want without fear of contradiction. Who knows? Either way - this section of this site is site is specifically here so that anyone with a comment, question, point to rise, etc regarding access databases can post with the knowledge that other likeminded people may read their post. It is not here as a general forum to discuss other matters. I have no doubt that if you are blocked from posting you will see this as yet another indication that MI5 is after yo...

Event ID 9098 followed by Event ID 2114
We are getting the following error on our Exchange 2003 SP1: Event ID: 9098 Source: MSExchangeSA Description: The MAD Monitoring thread was unable to read its configuration from the DS, error '0x08007077f'. This happens every five minutes and then every third error (after 15 minutes) we get the following error: Event ID: 2114 Source: MSExchangeDSAccess Description: Process IISIPM4490033D-6E20-4D26-802D-593632C17AB5-AP "EXCHANGEAPPLICATIONPOOL (PID=5188). Topology Discovery failed, error 0x8007077f. Appreciate any help or info. Thanks. Hey, check to see if all your domain...

What's the difference between Cross-posting and Multi-posting
And thanks for the discussion earlier... although the rudeness was unneeded. Sign me, A New User (and learning from you all) rochgal, you wrote on Thu, 22 Sep 2005 14:53:03 -0700: > What's the difference between Cross-posting and Multi-posting Cross-posting = You send one posting to several newsgroups. Multi-posting = You send several postings (with the same content) to several newsgroups. -- Best Regards Christian Goeller Some misspellings, grammatical or linguistical mistakes found? All corrections would be appreciated! ...

Post to GL
Hello I am having a problem with a setting within Great Plains 8.0 service pack 2. I have posting setup to only allow posting from the batch level for Inventory. But when you go into Inventory Batches the check box for post to gl is not marked. If I have it setup in posting to post to the gl shouldn't this check box be marked in inventory batches? -- Thanks, Brian Apples and oranges. The post to GL checkbox on the inventory batch window tells the system whether an IV transaction will post at all. The posting settings in tools --> setup --> posting tell the system w...

Event Handling Mechanism in Windows
I have posted this question to other groups. But did not find an answer. Here's the question. Any thoughts on this is highly appreciated. =================================================================== Hi, I have some doubts regarding the event handling process in Windows. I referred many books (Windows Internals, Programming Applications for Microsoft Windows, Windows System Programming) but could not find a complete picture of the event handling mechanism. I did search on the internet too. Can some one please point me towards any resource on the internet or some book that describe...

Intrastat posting issue
We are a UK company using intrastat. At the moment we cannot post invoices directly (thru) to the General ledger because we are getting an error saying that the 'intratsat information is missing'. When we click on an invoice that won't post in the Sales Transaction Entry screen, and click on the blue EC flag box, all the intrastat data is there and correct. Then when we post it goes through to the GL correctly. It seems that it will only post to the GL if every single line is checked (via the Blue EC flag) on the sales invoice regardless of the fact that all the date is alr...

Access 2002 bug: "dynamic" forms problem
There was no respond to my original post in microsoft.public.access.forms (May 5th 2007) about a fortnight so I try it here... ��������������������������������� A while ago we had a discussion about A2002 (sub)form which changes dynamically from code (hide/unhide controls, change subfom's width, etc.). There's a problem if I make some changes in code when the form is open: if I save changes, A2002 saves controls positions & subform's size as well. This is a BIG A2002 BUG and it's really annoying. Why Access forms don't behave as Visual Basic forms? I don't want Acc...

where is my post??
twice now I have typed up my post & sent it. So where is it? On Wed, 18 Jul 2007 08:41:36 -0700, Stapes <steve.staple@gmail.com> wrote: >twice now I have typed up my post & sent it. So where is it? On Google Groups: 1184773041.958329.270430@e16g2000pri.googlegroups.com Google's been having some problems lately, maybe it's temporarily unavailable. John W. Vinson [MVP] You mean the multiple posts with subject "Cancel = true"? I see 3 of them, and Allen Browne's already provided an answer. -- Doug Steele, Microsoft Access MVP http://I...

Excel WorkBook Event SheetDeactivate
1. Open an Excel workbook with Sheet1 and Sheet2. 2. Would like Sheet2 to scroll to cell A1 upon the Event of SheetDeactivate. 3. Background :Sheet1 contains hyperlinks leading to Sheet2 ; when a hyperlink is clicked, it does not initiate the SheetActivate Event of Sheet2. 4. Please suggest some means to deploy the Event of SheetDeactivate for Sheet2 (such that Sheet2 would have already scrolled to cell A1 when it is opened the next time by the clickable hyperlinks of Sheet1). 5. Regards. Hi TKT, Since there are only two sheets, why not use the Worksheet_Activate event for sheet1, e.g...

My post not posted!
A couple of times when I've posted a reply to a recent post (same day), and later tried to view it, I found the header with a line drawn through it, and the following in the message body view pane: Message is no longer available on the server Windows Live Mail is unable to retrieve the requested message because the server no longer has the message available. -------------------------------------------------------------------------------- News servers regularly expire articles as they get older to make space available for newer articles. IMAP servers can be accessed by multip...

Cannot send newsgroup post with an attachment
I can send and receive posts using Outlook Express 6 newsgroups. I do not use html. When I send a post that has an attachment, e.g. a 160kB jpg that post never shows up as having been sent. How can I fix this? regards, "nobody" I can't speak for others, but msnews has a 100KB limit. If I have a need to post a graphic, I upload it to TinyPic and post the link to it. TinyPic: http://tinypic.com/ -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "news.microsoft.com" <nobody@nowhere.com> wrote in message ...

Editing Sales Rep in a Posted Transaction
Does anyone know if there is a way to recall a transacrion just to change the associated sales rep? Hello Scarpa, You cannot change a transaction that has happened via the system's interface. You could modify the database using SQL or Access or a number of other tools... however that may not be the right thing to do. One of my clients was having this happen quite often... for example John sold it but it was rung up under Peter... so we created a return reason code for wrong sales rep... the cashier basically recalls the transaction for return.... picks the reason code and then eit...

Why my posting are not posted!
I am not sure why sometimes my postings are not posted! do you know why? Perhaps because you are using Microsoft's unreliable web interface to the newsgroup? Better to access the newsgroup directly, using a newsreader. -- David Biddulph "LABKHAND" <LABKHAND@discussions.microsoft.com> wrote in message news:635CB4A1-C4C9-4A80-AB93-3C8601E3F0DD@microsoft.com... >I am not sure why sometimes my postings are not posted! do you know why? "LABKHAND" <LABKHAND@discussions.microsoft.com> wrote: > I am not sure why sometimes my postings are...

Event ID 402
I am having a problem where my Exchange 2000 server is crashing about every 3 days. The system become unresponsive, and I cannot even reboot it properly at the console. After I reboot the only indication to me that there is a problem is this Stop event: Event ID: 402 Source: smtpsvc Virtual Server 1: x.x.x.x maximum number of connections has been reached. Connection being closed. Can anyone tell me what this message means??? ShootMePlease wrote: > I am having a problem where my Exchange 2000 server is crashing about every > 3 days. The system become unresponsive, and I cannot ...

Prior year posting 2 years
Client has 2009 open and all previous years closed. They want to post transactions to 2007. GP by default does not allow that. Is there a work around? Rich, There is no way to do this in GP out of the box. If they absolutely must post to 2007, the option I would recommend is to have the MBS Professional Services team open the 2008 year for your client, which will allow them to post to 2007, since that will now be the last closed year. Once done, the client would close 2008 again. Professional Services only does this as a consulting engagement and the cost will depend on a number of...

Transactions Lost Posting to GL
We've been using Great Plains (Dynamics V9) since 9/01/06, and are having some serious problems when posting to GL. In one case, one payment of two vouchers was lost going from A/P to GL. We only print about 30 checks a week, so at the end of the month when we posted to GL and noticed the discrepancy, it was relatively easy to track down the payment that was lost. The Accounting firm that helped with the installation was of no help. Their solution was to create a journal entry, which of course brough GL up to date, but didn't solve the problem. Now this month, we're about $8,000 of...

error in event log for PWA
Just curious if this might be related to my other post about users getting access denied, http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.project.server&mid=ddb75a86-cbc1-416a-9f98-3fded24d8286&sloc=en-us but I see the follwoing in the event log Event Type: Error Event Source: Office SharePoint Server Event Category: Project Server - General Event ID: 6058 Date: 1/19/2010 Time: 12:37:55 PM User: N/A Computer: ALFMOSWFE01 De...

User tried posting checks to closed period.
I have a user who tried to post payables checks to a closed period. They didn't tell me about it until after they had clicked through the error. The batch is showing a status of remittance processing. It doesn't show up under post checks or print checks but it does show up under edit checks. Nothing shows up under batch recovery. Is there a way to force the transactions on through? They have already mailed the checks so we don't have the option of voiding them somehow and redoing them. Robert Fann Sorry. I luckily found the batch under process remittance and ...

event id 529 after password change
Hi all, For security reasons we had to change the admin password on an SBS2003 box. Since then we are getting thousands of 529 errors from the workstations. They all look like this: Source security Category Logon/logiff Event ID 529 User NT Authority\System Logon Failure: Reason: Unknown user name or bad password User Name: administrator Domain: TTOWNSEND01 Logon Type: 3 Logon Process: NtLmSsp Authentication Package: NTLM Workstation Name: TTOWNSEND01 Caller User Name: - Caller Domain: - Caller Logon ID: - Caller Process ID: - Transited...

Posting negative 401k transactions
I have a typical 401k account setup with a corresponding cash account. I am manually balancing my account at the end of the quarter. In other words, I'm not using the 401k manager or "balance an account" wizard. In my investment account, I want to buy x shares of a stock for the quarter, however the final market value decreased for the account. Normally, a stock that increased for the quarter would show as a payment in the cash account. I want to show this as a deposit. If you use the balance an account wizard, it will somehow place a negative price so that it shows up as ...

How do I post a message to CDocument?
At the moment all ON_MESSAGE are handled in CMainFrame. I want to handle a message in CDocument but I can't get it to work. How is it done? Steve -- EasyNN-plus. The easy way to build neural networks. http://www.easynn.com Steve, > At the moment all ON_MESSAGE are handled in CMainFrame. > I want to handle a message in CDocument but I can't get it to work. > > How is it done? I don't know if this will help you, but you can recieve the message in CMainFrame then call a CDocument function to do whatever you want to do. You can access a CDocument object from wi...

Not posting
On my 2nd Station When I precess the debit card transaction I having trouble to post the transaction. Some Time I have to kill the POS using control,alt,delet. and If I go back to look for same transation and I am not able to find the same transaction under Journal view But I can see the same on edc under debit card. Any idea ? -- Thank You Harjit SherGill /DBA Altaville Market 324 South Main st po box 370 Altaville CA 95221 Tel : 209-729-1403 vendaliajat@yahoo.com ...