C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[28831] dll 을 사용하는데 잘 안됩니다.
박대성 [vartes] 12490 읽음    2004-02-17 14:46
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

이렇게 되어 있습니다. 무엇이 문제인지 궁금합니다.
그럼 좋은하루 되시고 아시는분 답변 부탁드립니다.





+ -

관련 글 리스트
28831 dll 을 사용하는데 잘 안됩니다. 박대성 12490 2004/02/17
34476     Re:dll 을 사용하는데 잘 안됩니다. 김용수 1222 2004/02/17
34475     Re:dll 을 사용하는데 잘 안됩니다. 빈센트 1189 2004/02/17
34474     Re:dll 을 사용하는데 잘 안됩니다. 빈센트 1117 2004/02/17
34473     Re:dll 을 사용하는데 잘 안됩니다. intothefree 2426 2004/02/17
34472     Re:dll 을 사용하는데 잘 안됩니다. 빈센트 1146 2004/02/17
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.