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

📄 java_callstaticmethod.h

📁 C调用Java的一个例子程序
💻 H
字号:
/* ^_^ 
 *
 *		Copyright (c) 2006 Hexin
 *
 *	Description:
 *	  TODO:
 *	Create:
 *		Date			  Time				Author
 *	------------------------------------------------
 *   2006-3-21           12:28:06			XiaoWei
 */

/* ^_^ 
 *	 Location : 
 *	 File     : JAVA_CallStaticMethod.h
 *	 Version  : 1.0.0.0
 *	 Note     : 
 */
#if defined(JNI_StaticMethodName) && defined(JNI_ReturnType)  

#ifdef  ReturnVoid
	#define JNI_Return 
#else 
	#define JNI_Return   return 
#endif


template<>
class JAVA_StaticMethod<JNI_ReturnType>  :public JAVA_StaticMethod_Base
{
public:
	typedef   JNI_ReturnType			_ReturnType;
	
	//template<typename _T0>
	_ReturnType operator()()
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID);
	}
	
	template<typename _T1>//1
		_ReturnType operator()(_T1 _t1)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1);
	}
	
	
	template<typename _T1,typename _T2>//2
		_ReturnType operator()(_T1 _t1,_T2 _t2)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2);
	}
	
	template<typename _T1,typename _T2,typename _T3>//3
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,t3);
	}
	
	template<typename _T1,typename _T2,typename _T3,typename _T4>//4
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4);
	}

	
	template<typename _T1,typename _T2,typename _T3,typename _T4,typename _T5>//5
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4,_T5 _t5)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4,_t5);
	}
	
	template<typename _T1,typename _T2,typename _T3,typename _T4,typename _T5,typename _T6>//6
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4,_T5 _t5,_T6 _t6)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4,_t5,_t6);
	}

	template<typename _T1,typename _T2,typename _T3,typename _T4,typename _T5,typename _T6,typename _T7>//7
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4,_T5 _t5,_T6 _t6,_T7 _t7)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4,_t5,_t6,_t7);
	}

	template<typename _T1,typename _T2,typename _T3,typename _T4,typename _T5,typename _T6,typename _T7,typename _T8>//8
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4,_T5 _t5,_T6 _t6,_T7 _t7,_T8 _t8)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4,_t5,_t6,_t7,_t8);
	}

	template<typename _T1,typename _T2,typename _T3,typename _T4,typename _T5,typename _T6,typename _T7,typename _T8,typename _T9>//9
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4,_T5 _t5,_T6 _t6,_T7 _t7,_T8 _t8,_T9 _t9)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4,_t5,_t6,_t7,_t8,_t9);
	}

	template<typename _T1,typename _T2,typename _T3,typename _T4,typename _T5,typename _T6,typename _T7,typename _T8,typename _T9,typename _T10>//10
		_ReturnType operator()(_T1 _t1,_T2 _t2,_T3 _t3,_T4 _t4,_T5 _t5,_T6 _t6,_T7 _t7,_T8 _t8,_T9 _t9,_T10 _t10)
	{
		_Method_Mul();
		JNI_Return  m_Method.m_lpEnv->JNI_StaticMethodName(m_Method.m_Class,m_Method.m_MethodID,_t1,_t2,_t3,_t4,_t5,_t6,_t7,_t8,_t9,_t10);
	}
};

#ifdef JNI_Return
	#undef  JNI_Return
#endif

#endif

⌨️ 快捷键说明

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