none
Need help, problem of importation

    Question

  • Hello everyone, and thank you for taking your time to try to help me,
    Then I explain my problem, I create an application that must "discuss" with a Canon camera, for that I imported the canon SDK (that I already had in another solution) so far no worries I know how to do, but when I try to use the methods contained in it brings me a problem of type:

    "Error CS1503 Argument 2 *: EOSDigital.SDK.ErrorCode [C: \ Users \ user \ Desktop \ PROJECT \\ DomeV2 \ SDK \ SDKEnums.cs (9)] can not be converted to 'EOSDigital.SDK.ErrorCode [C : \ Users \ user \ Desktop \ PROJECT \ EDSDKLib-1.1.2 \ EDSDKLib \ bin \ Release \ EDSDKLib.dll] 'DomeV2  C: \ Users \ user \ Desktop \ PROJECT \ DomeV2 \ DomeV2 \ "


    In case, I would call wrong method or whatever else here is a bit of my code, the method that creates this Error, is the ErrorHanddler.

        
        Internal protected Camera (IntPtr camRef)
            {
                If (camRef == IntPtr.Zero) throw new ArgumentNullException (nameof (camRef));
                CamRef = camRef;
                MainThread = new STAThread ();
                MainThread.Start ();
                MainThread.Invoke (() => ErrorHandler.CheckError (this, CanonSDK.EdsGetDeviceInfo (CamRef, out Info));
            }

    If someone has already had this problem or has a track to help me, I'm taker!

    Monday, April 3, 2017 7:14 AM

All replies

  • Can you double check the ErrorHandler you are using from, means which namespace + the parameters for EdsGetDeviceInfo ? Sharing the SDK methods would be helpful. In fact would suggest this question to Cannon forum

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, April 3, 2017 10:52 AM
  • "(that I already had in another solution)"

    I assume that you're reusing the code from the other solution? And you're include the SDKEnums.cs file in your project? You are also referencing the assembly EDSDKLib.dll. This isn't going to work. .NET considers a type to be unique based upon its full type name, which includes the assembly. Having 2 types with the same name does not make them the same type. By including the SDKEnums.cs file you are basically defining the types in the SDK as part of your assembly. But the DLL you're referencing has its own definition. You cannot mix these types. Since the DLL contains the type definitions, those are the one's you must use.

    Remove your SDKEnums.cs file. The assembly contains all the types you'll need to work with the SDK. You shouldn't have any files that contain any additional SDK types. Remove any other files that you might have added that are already contained in the assembly you're referencing.

    Michael Taylor
    http://www.michaeltaylorp3.net

    Tuesday, April 4, 2017 12:16 AM
    Moderator