|
比如用vc6 编写dll是可以的 .
选取DLL 工程
头文件如下
__declspec(dllexport) int __stdcall base64_decode (const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen) ;
__declspec(dllexport) int __stdcall base64_encode(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen) ;
再插入一个.def文件
LIBRARY BTREE
EXPORTS
base64_decode
base64_encode
实现base64
编译成base64Lib.dll。
然后再在 LR 中调用。
unsigned char input[]="[email=id=12333&u=liangjz&examid=1111&mail=yang@yahoo]id=12333&u=liangjz&examid=1111&mail=yang@yahoo[/email]";
unsigned char output[129]={0};
int rv;
unsigned long len=128;
lr_load_dll("D:\\c_proj\\base64Lib\\Debug\\base64Lib.dll");
rv= base64_encode(input,strlen(input),output,&len);
lr_error_message("rv=%d,out=%s\r\n",rv,output);
编译成DLL |
|