I have a c# windows form program in which I plan to use the FTDI FTD2XX_NET library

StackOverflow https://stackoverflow.com/questions/15246230

  •  18-03-2022
  •  | 
  •  

Question

I have a c# windows form program which uses the FTDI FTD2XX_NET library. How can I use specific FT_ commands like FT_GetDeviceInfo, FT_GetDriverVersion, etc? I have found in another answer this:

        FTD2XX_NET.FTDI.FT_STATUS ftStatus = FTD2XX_NET.FTDI.FT_STATUS.FT_OK;
        // Create new instance of the FTDI device class
        FTD2XX_NET.FTDI myFtdiDevice = new FTD2XX_NET.FTDI();

It works for me also, but I can't figure out how it works. Can someone explains to me how it works? I am a newbie, so please be analytical! Thank you in advance,

Was it helpful?

Solution

the usual way to utilize a library is first to add its reference (the library providers will provide a .dll file that you can link to after right clicking on the project name from server explorer then > Add Reference > Browse ...)

then you add using clause on top of your form code: using LibraryNameHere;

Now in that form you can use this library as per the details its developer has allowed you (classes, methods, enumerations etc)

Same is the case with other statements on top of the form's code such as: using System.Data; using System.Collections;

etc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top