|
c로 구성된 압축관련dll(compressor.dll)입니다.
이것을 사용하고 싶은데 잘 안돼는군요.
단순히 LoadLibrary 요걸로 했습니다.
void (__stdcall* compress)();
HINSTANCE hinst;
hinst = LoadLibrary("compressor.dll");
compress = (void (__stdcall*)())GetProcAddress(hinst,"compress");
FreeLibrary(hinst);
로딩/해제는 에러없이 넘어가는거 같습니다.
그러나 dll 안의 함수를 사용할때 다음과 같이 에러가 납니다.
unsigned char * compr, * uncompr;
unsigned long comprLen, uncomprLen;
-- 조작 --
comp = xx;
..
..
compress(compr, &comprLen, uncompr, uncomprLen); <- dll 함수
E2226: Extra Paremeter in Call 이런 에러가 납니다.
파라미터를 하나도없도록 compress(); 이렇게 하면 컴파일은 넘어가는군요.
하지만 파일명과 크기등을 넘겨줘야합니다.
저 함수의 헤더를 보면
#ifndef __COMPRESSOR_H
#define __COMPRESSOR_H
#ifdef __cplusplus
extern "C" int compress (unsigned char * dest, unsigned long * destLen,
const unsigned char * source, unsigned long sourceLen);
extern "C" int compress2 (unsigned char * dest, unsigned long * destLen,
const unsigned char * source, unsigned long sourceLen,
int level);
extern "C" int decompress (unsigned char * dest, unsigned long * destLen, const unsigned char * source, unsigned long sourceLen);
#else
int compress (unsigned char * dest, unsigned long * destLen,
const unsigned char * source, unsigned long sourceLen);
int compress2 (unsigned char * dest, unsigned long * destLen,
const unsigned char * source, unsigned long sourceLen,
int level);
int decompress (unsigned char * dest, unsigned long * destLen, const unsigned char * source, unsigned long sourceLen);
#endif
#endif
이렇게 되어 있습니다. 무엇이 문제인지 궁금합니다.
그럼 좋은하루 되시고 아시는분 답변 부탁드립니다.
|