Solved

App.StartLogging method is not working.

Posted on 1998-12-10
5
744 Views
Last Modified: 2013-11-26
When I try to use the App.startlogging method and the app.logevent to log events happening in my application, I get no results.  I then began to use the App.logmode property to check to see if the app.startlogging method was working, and it does not seem to be producing any changes.  For example...

Using the following code

Msgbox app.logmode
msgbox app.startlogging "Testfile.log", 2
msgbox app.logmode

For each message box, I get a zero result.  I figure I'm doing something stupid, but don't have any documentation that mentions error logging.
0
Comment
Question by:jsuper
5 Comments
 
LVL 3

Expert Comment

by:jjbyers
ID: 1449333
You need to use the logevent method of the app object.
0
 
LVL 1

Author Comment

by:jsuper
ID: 1449334
In the original question I mention that I use the logevent method to try to post messages to the log.  The problem is that those messages are never getting into the log because my original attempt to turn logging on failed.

0
 
LVL 4

Expert Comment

by:chabaud
ID: 1449335
Are u using win95 or winNT ?
0
 
LVL 3

Accepted Solution

by:
covington earned 50 total points
ID: 1449336
Compile your app. It will work fine.


INFO: App.LogEvent Only Logs in Compiled Applications
Article ID: Q161306
http://support.microsoft.com/support/kb/articles/q161/3/06.asp 
 


--------------------------------------------------------------------------------

The information in this article applies to:
Microsoft Visual Basic for Windows Learning, Professional, and Enterprise Editions, versions 5.0, 6.0
Microsoft Visual Basic Control Creation, Learning, Professional, and Enterprise Editions, for Windows, version 5.0


SUMMARY
In Microsoft Visual Basic, Event Logging allows an application to add information to either a user-defined file or the Microsoft Windows NT Event Log when a user-defined criteria is met.

This functionality is only available when running a compiled application. If you attempt to use the logging methods while in the Microsoft Visual Basic development environment, the logging methods will be ignored.
0
 
LVL 1

Author Comment

by:jsuper
ID: 1449337
Thanks for the info...   That did the trick!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question