Click here to Skip to main content
15,891,204 members
Articles / Programming Languages / Java / Java SE

Example of using Object-Oriented Java Native Interface in C++

Rate me:
Please Sign up or sign in to vote.
3.73/5 (10 votes)
3 Feb 2006CPOL4 min read 78.4K   1.8K   39  
Demonstrates an easy way of creating and embedding Java objects into C++ code, with Object-Oriented JNI.
/******************************************************************
 *  All rights reserved � 2005 Vitaly Shelest (Javain Ltd)
 *
 *  File name:              BaseException.h
 *
 *  Last modification:      20.03.2005
 *
 *  Description:            BaseException class
 *
 *  Authors:                Vitaly Shelest
 *
 *****************************************************************/

#pragma once

#include "SmartString.h"

namespace jni_helpers
{
    class BaseException
    {
    protected:
        CSmartString msg;
        
    public:
        BaseException()
        {
        }
        
        BaseException(const CSmartString& msg)
            : msg( msg )
        {
        }
        
        CSmartString getMessage()
        {
            return msg;
        }
    };
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Javain Ltd
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions