Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. using a third party dll

using a third party dll

Scheduled Pinned Locked Moved C / C++ / MFC
questionhardwarehelptutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    August Brower
    wrote on last edited by
    #1

    I have a piece of hardware (cash dispenser) that I'm trying to control with a PC. It comes with a Dll, but for the life of me I can't figure out how to use the dll. can someone please help me get started on this? It does have a manual with the dll describing the functions, but it is almost unintelligible. Here is some of the supplied literature, if it helps to answer the question 2.1.1 EVENT During ezLink protocol is handling, ezLink.dll notice protocol status to application program to create WM_USER_EZCDM_RECEIVE event as below WPARAM CODE COMMENT EVENT_RECV_RESPONSE 00001000H RESPONSE receiving EVENT_SEND_RETRYOVER 00001001H COMMAND sending failure EVENT_RECV_RETRYOVER 00001002H RESPONSE receiving failure WM_USER_EZCDM_RECEIVE event is defined as follows. #define WM_USER_EZCDM_RECEIVE (WM_USER+301) If EVENT_RECV_RESPONSE is generated, AP must receive Response to call the ezLinkRcv() function. 2.1.2 Recording Log Data ezLink.dll record LOG as below format. Recorded LOG FILE location is directory folder to be transmitted ezLinkPath(). LOG is recorded whenever DLL function is called. FILE NAME: (Generating File date (year month date) + ezCDM.txt) ex) 20060206ezCDM.txt FILE Generating Folder: selected folder path in the ezLinkPath() parameter. 2.2 DLL FUNCTION 2.2.1 ezLinkOpen ezLinkOpen Loads the DLL and opens the communication port. Syntax EZLINK_DLL_API UINT ezLinkOpen(SETINFO *pSetInfo); Parameters pSetInfo Structure with information to communicate with dll typedef struct { unsigned char uiPort; //communication port unsigned char ucDataBits; //Data bit unsigned char ucParity; //Parity bit unsigned char ucStopBits; //Stop bit unsigned long dwBaudRate; //Baud Rate HWND hwnd; //Parent window handle unsigned char ucCommandType; //command type(1: ezCDM-1000 ) }SETINFO Return Values EZLINK_SUCCESS Open port success Remarks If DLL opens ezCDM Communication-port successfully, returns the EZLINK_SUCCESS. 2.2.2 ezLinkClose ezLinkClose Closes the Communication Port. Syntax EZLINK_DLL_API UINT ezLinkClose(void); Parameters None Return Values EZLINK_SUCCESS Close port success Remarks If DLL closes ezCDM communication-port successfully, returns EZLINK_SUCCESS.

    C T G 3 Replies Last reply
    0
    • A August Brower

      I have a piece of hardware (cash dispenser) that I'm trying to control with a PC. It comes with a Dll, but for the life of me I can't figure out how to use the dll. can someone please help me get started on this? It does have a manual with the dll describing the functions, but it is almost unintelligible. Here is some of the supplied literature, if it helps to answer the question 2.1.1 EVENT During ezLink protocol is handling, ezLink.dll notice protocol status to application program to create WM_USER_EZCDM_RECEIVE event as below WPARAM CODE COMMENT EVENT_RECV_RESPONSE 00001000H RESPONSE receiving EVENT_SEND_RETRYOVER 00001001H COMMAND sending failure EVENT_RECV_RETRYOVER 00001002H RESPONSE receiving failure WM_USER_EZCDM_RECEIVE event is defined as follows. #define WM_USER_EZCDM_RECEIVE (WM_USER+301) If EVENT_RECV_RESPONSE is generated, AP must receive Response to call the ezLinkRcv() function. 2.1.2 Recording Log Data ezLink.dll record LOG as below format. Recorded LOG FILE location is directory folder to be transmitted ezLinkPath(). LOG is recorded whenever DLL function is called. FILE NAME: (Generating File date (year month date) + ezCDM.txt) ex) 20060206ezCDM.txt FILE Generating Folder: selected folder path in the ezLinkPath() parameter. 2.2 DLL FUNCTION 2.2.1 ezLinkOpen ezLinkOpen Loads the DLL and opens the communication port. Syntax EZLINK_DLL_API UINT ezLinkOpen(SETINFO *pSetInfo); Parameters pSetInfo Structure with information to communicate with dll typedef struct { unsigned char uiPort; //communication port unsigned char ucDataBits; //Data bit unsigned char ucParity; //Parity bit unsigned char ucStopBits; //Stop bit unsigned long dwBaudRate; //Baud Rate HWND hwnd; //Parent window handle unsigned char ucCommandType; //command type(1: ezCDM-1000 ) }SETINFO Return Values EZLINK_SUCCESS Open port success Remarks If DLL opens ezCDM Communication-port successfully, returns the EZLINK_SUCCESS. 2.2.2 ezLinkClose ezLinkClose Closes the Communication Port. Syntax EZLINK_DLL_API UINT ezLinkClose(void); Parameters None Return Values EZLINK_SUCCESS Close port success Remarks If DLL closes ezCDM communication-port successfully, returns EZLINK_SUCCESS.

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      It looks like you should

      1. call the ezLinkOpen function passing the serial port details.
      2. process the WM_USER_EZCDM_RECEIVE window message to get device notifications (and possibly call ezLinkRcv function: documentation is a bit messy on this point...)
      3. possibly use some other functions you have not reported here.
      4. call ezLinkClose function when you no longer need the device (and the library).

      :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      1 Reply Last reply
      0
      • A August Brower

        I have a piece of hardware (cash dispenser) that I'm trying to control with a PC. It comes with a Dll, but for the life of me I can't figure out how to use the dll. can someone please help me get started on this? It does have a manual with the dll describing the functions, but it is almost unintelligible. Here is some of the supplied literature, if it helps to answer the question 2.1.1 EVENT During ezLink protocol is handling, ezLink.dll notice protocol status to application program to create WM_USER_EZCDM_RECEIVE event as below WPARAM CODE COMMENT EVENT_RECV_RESPONSE 00001000H RESPONSE receiving EVENT_SEND_RETRYOVER 00001001H COMMAND sending failure EVENT_RECV_RETRYOVER 00001002H RESPONSE receiving failure WM_USER_EZCDM_RECEIVE event is defined as follows. #define WM_USER_EZCDM_RECEIVE (WM_USER+301) If EVENT_RECV_RESPONSE is generated, AP must receive Response to call the ezLinkRcv() function. 2.1.2 Recording Log Data ezLink.dll record LOG as below format. Recorded LOG FILE location is directory folder to be transmitted ezLinkPath(). LOG is recorded whenever DLL function is called. FILE NAME: (Generating File date (year month date) + ezCDM.txt) ex) 20060206ezCDM.txt FILE Generating Folder: selected folder path in the ezLinkPath() parameter. 2.2 DLL FUNCTION 2.2.1 ezLinkOpen ezLinkOpen Loads the DLL and opens the communication port. Syntax EZLINK_DLL_API UINT ezLinkOpen(SETINFO *pSetInfo); Parameters pSetInfo Structure with information to communicate with dll typedef struct { unsigned char uiPort; //communication port unsigned char ucDataBits; //Data bit unsigned char ucParity; //Parity bit unsigned char ucStopBits; //Stop bit unsigned long dwBaudRate; //Baud Rate HWND hwnd; //Parent window handle unsigned char ucCommandType; //command type(1: ezCDM-1000 ) }SETINFO Return Values EZLINK_SUCCESS Open port success Remarks If DLL opens ezCDM Communication-port successfully, returns the EZLINK_SUCCESS. 2.2.2 ezLinkClose ezLinkClose Closes the Communication Port. Syntax EZLINK_DLL_API UINT ezLinkClose(void); Parameters None Return Values EZLINK_SUCCESS Close port success Remarks If DLL closes ezCDM communication-port successfully, returns EZLINK_SUCCESS.

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Does your third party vendor has any forums or support personal. they may be able to guide you in right direction!

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        1 Reply Last reply
        0
        • A August Brower

          I have a piece of hardware (cash dispenser) that I'm trying to control with a PC. It comes with a Dll, but for the life of me I can't figure out how to use the dll. can someone please help me get started on this? It does have a manual with the dll describing the functions, but it is almost unintelligible. Here is some of the supplied literature, if it helps to answer the question 2.1.1 EVENT During ezLink protocol is handling, ezLink.dll notice protocol status to application program to create WM_USER_EZCDM_RECEIVE event as below WPARAM CODE COMMENT EVENT_RECV_RESPONSE 00001000H RESPONSE receiving EVENT_SEND_RETRYOVER 00001001H COMMAND sending failure EVENT_RECV_RETRYOVER 00001002H RESPONSE receiving failure WM_USER_EZCDM_RECEIVE event is defined as follows. #define WM_USER_EZCDM_RECEIVE (WM_USER+301) If EVENT_RECV_RESPONSE is generated, AP must receive Response to call the ezLinkRcv() function. 2.1.2 Recording Log Data ezLink.dll record LOG as below format. Recorded LOG FILE location is directory folder to be transmitted ezLinkPath(). LOG is recorded whenever DLL function is called. FILE NAME: (Generating File date (year month date) + ezCDM.txt) ex) 20060206ezCDM.txt FILE Generating Folder: selected folder path in the ezLinkPath() parameter. 2.2 DLL FUNCTION 2.2.1 ezLinkOpen ezLinkOpen Loads the DLL and opens the communication port. Syntax EZLINK_DLL_API UINT ezLinkOpen(SETINFO *pSetInfo); Parameters pSetInfo Structure with information to communicate with dll typedef struct { unsigned char uiPort; //communication port unsigned char ucDataBits; //Data bit unsigned char ucParity; //Parity bit unsigned char ucStopBits; //Stop bit unsigned long dwBaudRate; //Baud Rate HWND hwnd; //Parent window handle unsigned char ucCommandType; //command type(1: ezCDM-1000 ) }SETINFO Return Values EZLINK_SUCCESS Open port success Remarks If DLL opens ezCDM Communication-port successfully, returns the EZLINK_SUCCESS. 2.2.2 ezLinkClose ezLinkClose Closes the Communication Port. Syntax EZLINK_DLL_API UINT ezLinkClose(void); Parameters None Return Values EZLINK_SUCCESS Close port success Remarks If DLL closes ezCDM communication-port successfully, returns EZLINK_SUCCESS.

          G Offline
          G Offline
          Garth J Lancaster
          wrote on last edited by
          #4

          seems fairly simple - in addition to what esteemed CPallini said 1) look for a .h file supplied by the vendor, #include it in your code - you could probably start with a MFC dialog project to get the ease of message maps etc - then you can define a Onxyz handler for the WM_USER_EZCDM_RECEIVE message ... 2) if the vendor has a '.lib' file with their SDK, you'll need to add it to additional libraries settings under link options usually vendors provide some sort of sample - as ThatsAlok says, maybe their support site has info - if they can give you one its a good start

          A 1 Reply Last reply
          0
          • G Garth J Lancaster

            seems fairly simple - in addition to what esteemed CPallini said 1) look for a .h file supplied by the vendor, #include it in your code - you could probably start with a MFC dialog project to get the ease of message maps etc - then you can define a Onxyz handler for the WM_USER_EZCDM_RECEIVE message ... 2) if the vendor has a '.lib' file with their SDK, you'll need to add it to additional libraries settings under link options usually vendors provide some sort of sample - as ThatsAlok says, maybe their support site has info - if they can give you one its a good start

            A Offline
            A Offline
            August Brower
            wrote on last edited by
            #5

            thanks for the help guys. I think my first step is going to be finding a .h I think after that and all your advice I can get it done. augie

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups