DLL 만들기
new  - > win32 Dynamic-link Library -> A simple Dll project
하면 끝...
여기에 Java  include에 포함 시키고  설정한다음에 프로그램 작성하면 끝~~~
Jni 해더 파일은 만드는법은 인터넷 찾아보면 많으니까 찾아보시고.
그다음작업하면 완료 ~~`
class aaa
{
static {System.loadLibrary("로드할 DLL 이름");}
public native int diviceStateChange(int iState , byte[] blDiveName); /// 이부분은 C++ DLL과 이름이 동일해야한다.
public int diviceStateChange(int iState , String strDiveName) throws Exception
{
//내부코딩 리턴값 설정
int iRet = diviceStateChange(iState,getEndNullByte(strDiveName));
return iRet ; // 이정도 ?
}
}
///////
매인에서는 
aa _aa= new aa(); 
_aa.getInstance();
int  k  = _.aa.diviceStateChange(0,"COM3"); 
System.out.println(k);
 요런식으로 사용하면 끝