请问各位老大以dll编译的问题
本人写了个dll要在java中调用
ShowMsgBox.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class ShowMsgBox */
#ifndef _Included_ShowMsgBox
#define _Included_ShowMsgBox
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: ShowMsgBox
* Method: ShowMessage
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_ShowMsgBox_ShowMessage
(JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
#endif
// fds.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "ShowMsgBox.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
JNIEXPORT void JNICALL Java_ShowMsgBox_ShowMessage(JNIEnv * jEnv, jobject this, jstring jMsg) {
/* const char * msg;
msg = (*jEnv)->GetStringUTFChars(jEnv, jMsg,0);
MessageBox(HWND_DESKTOP, msg,
"Thinking in Java: JNI",
MB_OK | MB_ICONEXCLAMATION);
(*jEnv)->ReleaseStringUTFChars(jEnv, jMsg,msg);*/
}
可是在vc6种编译,总出现
:\vc6\MSDev98\MyProjects\fds\fds.cpp(13) : error C2143: syntax error : missing ')' before 'this'
D:\vc6\MSDev98\MyProjects\fds\fds.cpp(13) : error C2143: syntax error : missing ';' before 'this'
D:\vc6\MSDev98\MyProjects\fds\fds.cpp(13) : error C2143: syntax error : missing ';' before 'this'
D:\vc6\MSDev98\MyProjects\fds\fds.cpp(13) : error C2059: syntax error : ')'
D:\vc6\MSDev98\MyProjects\fds\fds.cpp(13) : error C2143: syntax error : missing ';' before '{'
D:\vc6\MSDev98\MyProjects\fds\fds.cpp(13) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.
的错,本人初学vc,请各位老大多指教
问题点数:0、回复次数:1Top
1 楼cryincold(夜来☆幽梦忽还【湘】)回复于 2003-06-02 18:20:37 得分 0
呀 !! java 中调用。。 偶不会噢Top




