#include "stdafx.h" #include <basetyps.h> #include <jni.h> #include "HelloPopup.h" #include <windows.h> typedef int * (_stdcall * OPENCOM) (int ComPort); HINSTANCE dllHandle; int result; /* * Class: HelloPopup * Method: OpenSerialPort * Signature: (I)I */`enter code here` JNIEXPORT jint JNICALL Java_HelloPopup_OpenSerialPortDll (JNIEnv * env, jobject obj, jint ComPort) { OPENCOM pOpenCom ; dllHandle=LoadLibrary ("AlzData.dll"); POpenCom = (OPENCOM) GetProcAddress (dllHandle, "OpenSerialPort"); int * ret = (* pOpenCom) (ComPort); result=pOpenCom(ComPort); FreeLibrary (dllHandle); return result; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)