⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 java_method.cpp

📁 C调用Java的一个例子程序
💻 CPP
字号:
// JAVA_Method.cpp: implementation of the JAVA_Method class.
//
//////////////////////////////////////////////////////////////////////


#include "../header/JAVA_Method.h"


bool	s_JAVA_Method::loadMethod(JAVA_Object & _object,const char* name,const char * sig)
{
	JNI_MethodID __Method = JAVA_Base::GetMethodID(_object.getEnv(),_object.getClass(),name,sig);
	JAVA_ASSERT_MSG(__Method == JNI_NULL,sig);
	if (__Method) {
		this->setMethod(_object.getEnv(),__Method,_object.getObject(),_object.getClass());
		return true;
	}
	this->setMethod(_object.getEnv(),__Method,_object.getObject(),_object.getClass());
	return false;
}

void s_JAVA_Method::setMethod(JNI_Env* _lpEnv,JNI_MethodID _m,JNI_Object _o,JNI_Class _c)
{
	m_lpEnv = _lpEnv; 
	m_MethodID = _m; 
	m_Object = _o;
	m_Class = _c;
}

void s_JAVA_Method::clear()
{
	m_lpEnv = 0; 
	m_MethodID = 0; 
	m_Object = 0;
	m_Class = 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -