get started

//java_md.c

/* Load the Java VM DLL */
if ((handle = LoadLibrary(jvmpath)) == 0) {
ReportErrorMessage2("Error loading: %s", (char *)jvmpath, JNI_TRUE);
return JNI_FALSE;
}

/* Now get the function addresses */
ifn->CreateJavaVM =
(void *)GetProcAddress(handle, "JNI_CreateJavaVM");
ifn->GetDefaultJavaVMInitArgs =
(void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs");


LoadLibrary, GetProcAddress分别用于windows下加载DLL和获取DLL中函数的地址

你可能感兴趣的:(java,JNI,Java,Windows,C,C++)