Solved

com.ms.util.* question.

Posted on 2001-07-06
8
322 Views
Last Modified: 2007-12-19
how and where do I find out what classes are available for this package?

anyone familiar with the com.ms.util.EventLog class?
what methods are there in this class?

I use this class to log something into NT's eventlog, how do I register the msg.dll which contains the message structure?

anyone have done that should know what I am talking about. I know how to do it in VB, but new to Java.

Thanks for any comments in advanced here.

0
Comment
Question by:chrislee8
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6259851
If you aren't using Microsoft J++, you can't use these classes. They are Microsoft specific and incompatible with any other JVM, even for Windows itself.

As a general rule: If you want to do something very Windows specific (example: NT's event log), it is not supported in Java. You can program almost everything using native libraries, but the question is more often than not: Why should you?

If you want to program specifically for Windows, stick with VB and with J++. If you want to program for other platforms, for example for Unix or Apple Macintosh, then the Windows specific things (like the NT event log) doesn't even exist, so it doesn't make sense to program for such a thing.

Just a small pointer: With JIntegra for example you can access COM objects from Java, and do it even in 100% pure Java. See www.linar.com. Be warned, however, this is not a simple, fast solution to your problem.
0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6259860
The link is misspelt. It should be: www.linar.com/jintegra
0
 

Author Comment

by:chrislee8
ID: 6260342
well, very clear explaination on Java and J++.
but I understand that totally. :)

and one more thing, MS SDK for Java 4.0 does work with com.ms.util.EventLog too, not only J++. I know this one. I have done that.

because they both come from MS, I guess on this one.

I do want to do this task under MS environment.

I am a kind of person that wants to learn deep inside of what I going to learn. so I want to know more info on com.ms.util.* and com.ms.util.EventLog.

any place to tell the details like whitepaper?

I searched on MS site, no result found.

so anyone can tell me more on those ones?

Thank you for your info though, very helpful.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:chrislee8
ID: 6260372
one more thing on the JIntegra, i think it rocks, I wish I can do that. gotta work on that. :)
0
 
LVL 3

Expert Comment

by:dnoelpp
ID: 6261480
See following links:

A chapter about Java 2 (about "dirty" Java by M$)

http://utenti.tripod.it/yanorel6/2/ch54.htm

Lots of technical articles about M$ Java

http://www.microsoft.com/java/resource/techart.htm

When you download this, then you have all documentation you need (I think so, I started downloading it and didn't check it out yet).

http://a128.ms.a.microsoft.com/f/128/1611/2h/download.microsoft.com/download/javasdk/install/4.0/win98/en-us/SDKDocs40.exe

When this link doesn't work, try clicking on "Documentation Only" link on this page:

http://www.microsoft.com/java/download/dl_sdk40.htm

Cheers!
0
 
LVL 7

Expert Comment

by:Igor Bazarny
ID: 6262072
Hi,

You need to use MS jvm to make use of com.ms.* classes. Run you program using jview instead of java. But note that MS java stopped at 1.1 version, with modified or stripped down JNI and RMI. I don't believe that there are any chances to get better java support from Microsoft.

Regards,
Igor Bazarny,
Brainbench MVP for Java 1
www.brainbench.com
0
 
LVL 3

Accepted Solution

by:
dnoelpp earned 50 total points
ID: 6262109
I looked at the downloaded documentation from M$. There is information about the class Eventlog:

*** Copied from documentation ***

EventLog Class
The EventLog Class of the com.ms.util package implements an event log. It is based directly upon the Microsoft? Win32? event log APIs, RegisterEventSource, ReportEvent, and DeregisterEventSource.

public class EventLog
{
  // Fields
  public static final short AUDIT_FAILURE;
  public static final short AUDIT_SUCCESS;
  public static final short ERROR;
  public static final short INFORMATION;
  public static final short SUCCESS;
  public static final short WARNING;

  // Constructors
  public EventLog(String source);
  public EventLog(String server, String source);

  // Methods
  protected void finalize();
  public void reportEvent(short type, short cat, int id,
        String[] msg, byte[] data);
  public void reportEvent(short type, short cat, int id,
        String msg, byte[] data);
  public void reportEvent(short type, short cat, int id,
        String[] msgs);
  public void reportEvent(short type, short cat, int id,
        String msg);
  public void reportEvent(short type, short cat, int id);
}

For more information on implementing and using event logs, see the Win32 documentation.

*** Copied from the documentation ***

To read more details yourself, click on the file sdkdocs.chm, then "Microsoft Packages References", then on "com.ms.util Package", then on "EventLog Class". If you installed the SDK already, you should find documentation in the Docs subdirectory of the installation directory.
0
 

Author Comment

by:chrislee8
ID: 6299760
This is it!

Thank you
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Spring Framework HTTPSession management 1 35
Should localization be done inside spring controller 5 26
Desingning Refactoring existing code 2 24
login form jsp example 2 25
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

773 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