上面的程序是java2dll.c,偶老是编译不通过???
解决方案 »
- java 每隔一段时间检测ftp文件夹内最新的文件名称,修改时间等
- 跨行显示记录
- 求jspSmartUpload.zip邮箱是[email protected]
- 如何仅用JSP实现页面的跳转?
- jsp中怎样读出上传文件的大小
- 非常紧急!救命:JSP上传图片到数据库中的问题,在线等啊
- 如何把“:”替换成“$”
- 连接数据库出现下列错误!!!在线恭候回音!
- 奇怪的中文问题???第一次中文显示为乱码,但以后就正常显示了
- 求助:使用spring配置 mybatis和struts总是报错 sqlsessionfactory说没找到,搞了快1天了还是老样子
- 从sqlserver/image类型读取文件的问题。
- 如何刷新iframe所调用的页面?
t.c#include <stdio.h>
#include "Java2DocdllAccess.h"int RunDllInit(char* fileName)
{
void (*MYPROC)(void);
HINSTANCE hlib;
int (*LOAD)(char* fileName);//定义函数指针
int retvalue; //函数返回
LOAD lpFunc;
hLib=LoadLibrary("Maker.dll");
if(hLib==NULL)
{
printf("exit load dll");
exit(-1);
}
AfxSetResourceHandle(hLib);
//调用name.dll的方法Abstract
lpFunc=(LOAD)GetProcAddress(hLib,"Init");
if(lpFunc==NULL)
{
printf("exit load fun");
exit(-1);
} retvalue = (lpFunc)(fileName);
FreeLibrary(hLib); return retvalue;
}
JNIEXPORT jlong JNICALL Java_Java2DocdllAccess_RunDllInit
(JNIEnv *env, jobject obj)
{
return RunDllInit();
}
int RunDllNewDoc(char* fileName)
{
void (*MYPROC)(void);
HINSTANCE hlib;
int (*LOAD)(char* fileName);//定义函数指针
int retvalue; //函数返回
LOAD lpFunc;
hLib=LoadLibrary("Maker.dll");
if(hLib==NULL)
{
printf("exit load dll");
exit(-1);
}
AfxSetResourceHandle(hLib);
//调用name.dll的方法Abstract
lpFunc=(LOAD)GetProcAddress(hLib,"NewDoc");
if(lpFunc==NULL)
{
printf("exit load fun");
exit(-1);
} retvalue = (lpFunc)(fileName);
FreeLibrary(hLib); return retvalue;
}
JNIEXPORT jlong JNICALL Java_Java2DocdllAccess_NewDoc
(JNIEnv *env, jobject obj, jstring str1, jstring str2)
{
return RunDllNewDoc(str1,str2);
}
Compiling...
t.c
c:\dll\t.c(7) : error C2065: 'HINSTANCE' : undeclared identifier
c:\dll\t.c(7) : error C2146: syntax error : missing ';' before identifier 'hlib'
c:\dll\t.c(7) : error C2065: 'hlib' : undeclared identifier
c:\dll\t.c(8) : error C2143: syntax error : missing ';' before 'type'
c:\dll\t.c(9) : error C2143: syntax error : missing ';' before 'type'
c:\dll\t.c(11) : error C2065: 'LOAD' : undeclared identifier
c:\dll\t.c(11) : error C2146: syntax error : missing ';' before identifier 'lpFunc'
c:\dll\t.c(11) : error C2065: 'lpFunc' : undeclared identifier
c:\dll\t.c(12) : error C2065: 'hLib' : undeclared identifier
c:\dll\t.c(12) : warning C4013: 'LoadLibrary' undefined; assuming extern returning int
c:\dll\t.c(13) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *'
c:\dll\t.c(16) : warning C4013: 'exit' undefined; assuming extern returning int
c:\dll\t.c(19) : warning C4013: 'AfxSetResourceHandle' undefined; assuming extern returning int
c:\dll\t.c(21) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
c:\dll\t.c(21) : warning C4013: 'GetProcAddress' undefined; assuming extern returning int
c:\dll\t.c(22) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *'
c:\dll\t.c(28) : error C2065: 'retvalue' : undeclared identifier
c:\dll\t.c(28) : error C2064: term does not evaluate to a function
c:\dll\t.c(29) : warning C4013: 'FreeLibrary' undefined; assuming extern returning int
c:\dll\t.c(38) : error C2198: 'RunDllInit' : too few actual parameters
c:\dll\t.c(45) : error C2146: syntax error : missing ';' before identifier 'hlib'
c:\dll\t.c(46) : error C2143: syntax error : missing ';' before 'type'
c:\dll\t.c(47) : error C2143: syntax error : missing ';' before 'type'
c:\dll\t.c(49) : error C2146: syntax error : missing ';' before identifier 'lpFunc'
c:\dll\t.c(51) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *'
c:\dll\t.c(59) : error C2146: syntax error : missing ';' before identifier 'GetProcAddress'
c:\dll\t.c(60) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *'
c:\dll\t.c(66) : error C2064: term does not evaluate to a function
c:\dll\t.c(74) : warning C4133: 'function' : incompatible types - from 'struct _jobject *' to 'char *'
c:\dll\t.c(74) : warning C4020: 'RunDllNewDoc' : too many actual parameters
Error executing cl.exe.t.obj - 19 error(s), 11 warning(s)