简体   繁体   中英

Not able to add dll in VS2010

I am trying to add the following dll as reference in the VS2010. but it keeps throwing the "Please make sure it is a valid assembly or com" error. When I tried to register the dll using regsvr32, it says "Not able to find an entry point". Can you please let me know how to make it work?

The dll can be downloaded from Here

The example C# code provided by the vendor is Here

EDIT:

The example code does use DllImport property. When I run it, it says not able to find the dll. So I was trying to add it as a reference. I am new to C# so not sure what the problem is. It breaks in the following line :

ftStatus = GetDllVersion(byteDllVersion, MAX_NUM_DLL_VERSION_CHARS);

Line 747 in the example code.

Thanks...

If the dll is not developed under .Net , then you con not add it as a reference to your project. Paste your dll in the Application startup path(Bin\\Debug) and import the dll like

 [DllImportAttribute(@".\FTCI2C64.dll", EntryPoint = "I2C_GetDllVersion", CallingConvention = CallingConvention.Cdecl)]
    static extern uint GetDllVersion(byte[] pDllVersion, uint buufferSize);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM