1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help on wrapper dll.

Discussion in 'C++' started by kurtoz, Nov 13, 2008.

  1. kurtoz

    kurtoz New Member

    Joined:
    Nov 13, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi guys,

    I'm developing an app in VB with a provided DLL from 3rd party. The SDK they provided includes a .dll file, .h file and .lib file, however this dll was written in CDECL calling convention which is unable to use in VB. So I started to do the wrapping DLL in STDCALL in C++ that calling functions from existing DLL, but my knowledge in C++ is very limited and I have no idea where should I start it with.

    Here is the code of .h file:

    Code:
    #define IVCSDK68_API extern "C" __declspec(dllexport)
    
    IVCSDK68_API int IVCSDK68_InitSDK();
    IVCSDK68_API int IVCSDK68_CloseSDK();
    
    IVCSDK68_API int IVCSDK68_SetDeviceOutputFormat(ColorSpace  pCSType, VideoSize  pVSize);	
    IVCSDK68_API int IVCSDK68_GetDeviceOutputFormat(ColorSpace *pCSType, VideoSize *pVSize);
    IVCSDK68_API int IVCSDK68_SetVideoWindows(int iDeviceNum,int iChannelNum, CWnd *pWnd);
    
    Should I have to include the .lib file into my new DLL project? Any guidance would be highly appreciated.
     
  2. imported_xpi0t0s

    imported_xpi0t0s New Member

    Joined:
    Jul 18, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    Depends how you're linking with the 3rd party DLL. If you're statically linking then you need the .lib, but if you're dynamically loading with LoadLibrary et al then you don't need to link the .lib. This applies to all DLL linkages.
     

Share This Page