One small step for a man
One Giant leap for the mankind

There is no wealth like Knowledge
                            No Poverty like Ignorance
Journal of Emerging Trends in Computing and Information Sciences Logo

Journal of Emerging Trends in Computing and Information Sciences >> Call for Papers Vol. 8 No. 3, March 2017

Journal of Emerging Trends in Computing and Information Sciences

Java and C/C++ Interoperability: Java Integration to Windows Event Log

Full Text Pdf Pdf
Author Aleksandar Bulajic, Slobodan Jovanovic
ISSN 2079-8407
On Pages 1398-1410
Volume No. 3
Issue No. 10
Issue Date November 01, 2012
Publishing Date November 01, 2012
Keywords Java, Interoperability, JNI, C, C++, Event Log


Abstract

SUN Java provides a mechanism for integration with functions coded in C/C++ or assembler, and basically offers two frameworks: Java Native Interface (JNI), and Java Native Access (JNA). In this paper, each of these two frameworks are first described, and then JNI is demonstrated with an example code, which uses Java code to write to the Windows Event Log through code written in C/C++. Event Log is a standard Windows OS feature and is used to log messages. Java usually does not use Windows Event Log to log messages, but in cases when it is necessary, this example demonstrates how it can be achieved. The beginning of this paper is dedicated to the JNI framework and data mapping, and the JNI interface pointer that allows C/C++ functions to interact with the JNI environment. Interaction in this case is bidirectional, which means that Java code is able to interact with code written in C/C++ and C/C++ code is able to interact with Java code. This paper provides a detailed description of the source code and a Visual Studio project for creating a C/C++ DLL library that is able to write to the Windows Event Log, and also offers a detailed description of source code of an Eclipse Java project that writes to the Windows Event Log through the C/C++ DLL library.  

Back

Seperator
    Journal of Computing | Call for Papers (CFP) | Journal Blog | Journal of Systems and Software | ARPN Journal of Science and Technology | International Journal of Health and Medical Sciences | International Journal of Economics, Finance and Management     
Copyrights
© 2015 Journal of Computing