Jump to content

smcnally

Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by smcnally

  1. This header file uses a very strange and unusal way to define the function prototypes in the DLL. In fact it does not define any prototypes but just function pointer types. That's definitely not a standard way to incorporate this DLL into once own code even in C.

    Try to change for all functions

    DWORD (*MPUSBGetDLLVersion)(void);

    to

    DWORD MPUSBGetDLLVersion(void);

    basically removing the brackets around the function names and also the * in front of the function name and then try to import this again with the DLL import tool.

    Now it should work.

    Rolf Kalbermatter

    Thanks Rolf

    Another Question. Below is the .h file

    #ifndef _MPUSBAPI_H_

    #define _MPUSBAPI_H_

    #define MPUSB_FAIL 0

    #define MPUSB_SUCCESS 1

    #define MP_WRITE 0

    #define MP_READ 1

    // MAX_NUM_MPUSB_DEV is an abstract limitation.

    // It is very unlikely that a computer system will have more

    // then 127 USB devices attached to it. (single or multiple USB hosts)

    #define MAX_NUM_MPUSB_DEV 127

    DWORD (*MPUSBGetDLLVersion)(void);

    DWORD (*MPUSBGetDeviceCount)(PCHAR pVID_PID);

    HANDLE (*MPUSBOpen)(DWORD instance, // Input

    PCHAR pVID_PID, // Input

    PCHAR pEP, // Input

    DWORD dwDir, // Input

    DWORD dwReserved); // Input <Future Use>

    DWORD (*MPUSBRead)(HANDLE handle, // Input

    PVOID pData, // Output

    DWORD dwLen, // Input

    PDWORD pLength, // Output

    DWORD dwMilliseconds); // Input

    DWORD (*MPUSBWrite)(HANDLE handle, // Input

    PVOID pData, // Input

    DWORD dwLen, // Input

    PDWORD pLength, // Output

    DWORD dwMilliseconds); // Input

    DWORD (*MPUSBReadInt)(HANDLE handle, // Input

    PVOID pData, // Output

    DWORD dwLen, // Input

    PDWORD pLength, // Output

    DWORD dwMilliseconds); // Input

    BOOL (*MPUSBClose)(HANDLE handle);

    #endif

    Labview does not seem to understand PVOID,DWORD,PWORD, and BOOL datatypes. I beleive these are DELPHI datatypes. What would you recommend me using for Labview recognized datatypes instead? also to I need to define my variable name as weill i.e. #define Data void

    Thanks for the help

    Steve M.

  2. Sorry, I am new to using call library function and don't know where to begin. I tried using the import shared library (.dll) tool to create vi's for each function in my dll. When I load the supplied .h file it seems like my definitions are not recognized. could someone please show me how to create a labview vi for calling the functions in the attached .dll? It's been several years since I've dealt with C code/and defintions and variable types.

    Thanks

    Steve M.

    Download File:post-7342-1170954787.zip

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.