简体   繁体   中英

How can i add the canon digital camera dll files to my project?

I went to this site:

https://www.didp.canon-europa.com/developer/didp/didp_main.nsf?opendatabase&login

I have a login and i have downloaded the version 2.1 of the sdk/edsdk On my hard disk i have some directories one is with a class: EDSDK.cs i have added it to my project no problems.

Then i went to the directory: EDSDK>Dll I tried to add there all the dll's and each one of them can't be added. For some reason on all of them i'm getting the erorr:

Could not be added please make sure the file is accessible and that is valid assembly or COM.

I tried to go through this instruction by someone else who did it and managed to make it work here:

http://dickchiang.blogspot.co.il/2008/01/programming-with-canon-digital-camera.html

This comment:

Dick Chiang said... Assuming you have EDSDK 2.1 (the same version I'm using), you would do something like: 1. Create a new project under VS2005; 2. Copy/include a copy of the EDSDK.cs class file that came with the EDSDK (I appears under the SAMPLE\\CSharp\\COMMON on my installation) into your project; 3. Copy all the DLL's found under the EDSDK\\DLL folder onto your project output folder (not sure if there's a simpler way to do this by specifying the path where to look for the DLL's); 4. write your program to access the SDK via the EDSDK.cs class file that I mentioned in item 2.

I'm using visual studio c# 2012 pro windows 8 64bit

I can't email to the site where i have downloaded the sdk/edsdk since they are not supporting this things. I tried to email them before and they are not supporting.

What else can i do ?

Those are native dlls, so you don't add them through the Add References dialog. You simply copy them into your project directory and add them to source control via windows explorer. Then in VS you right-click your project and choose "Add Existing Item" and add them that way. Finally once they're added, you need to go into their properties in VS and change the Build Action to Content, and Copy to .. to "Copy if Newer".

The dll's functions are called via P/Invoke from C#, and the EDSDK.cs class provides a wrapper around all those calls if you look at it. The above steps make sure that the EDSDK dlls are copied to your build path when you compile your app, so that the compiled EDSDK.cs code can find them for the p/invoke calls.

Read up on p/invoke to get a better understanding.

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