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#
  4. Trouble using Canon's EDSDK in VS on mac

Trouble using Canon's EDSDK in VS on mac

Scheduled Pinned Locked Moved C#
tutorialcsharpswifthelpvisual-studio
2 Posts 2 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.
  • M Offline
    M Offline
    Member 15431457
    wrote on last edited by
    #1

    I am trying to communicate with a EOS Rebel T7 on mac, but haven't had any luck. I downloaded the latest version of the SDK, but could not test the Objective-C sample because I don't (can't yet) have Xcode on my computer. I found this C# project to be instructive. Ultimately I was able to get the following C# code to compile without errors:

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using EOSDigital.API;
    using EOSDigital.SDK;

    namespace ConsoleExample
    {
    class Program
    {
    static CanonAPI APIHandler;
    static Camera MainCamera;
    static string ImageSaveDirectory;
    static bool Error = false;
    static ManualResetEvent WaitEvent = new ManualResetEvent(false);

        static void Main(string\[\] args)
        {
            CanonSDK.InitializeVersion();
    
            IntPtr camPtrList;
            CanonSDK.EdsGetCameraList(out camPtrList);
    
            int camCount;
            CanonSDK.EdsGetChildCount(camPtrList, out camCount);
            Console.WriteLine(camCount + " cameras found.");
        }
    }
    

    }

    However, I end up with camCount==0; "0 cameras found". I thought this might be because the EOS Utility (which opens automatically when plugging in the camera) is occupying the necessary resources, however I tried uninstalling EOS Utility and this did not help. Can anyone provide a simple example that I can test (that doesn't require Xcode) in VS or VScode? Any help or advice would be much appreciated. Thank you! PS: Figuring out how to compile in VS on mac was a struggle as I am unfamiliar with both, so I'm open to any suggestions for other IDEs/compilers/languages if it will make using EDSDK easier.

    L 1 Reply Last reply
    0
    • M Member 15431457

      I am trying to communicate with a EOS Rebel T7 on mac, but haven't had any luck. I downloaded the latest version of the SDK, but could not test the Objective-C sample because I don't (can't yet) have Xcode on my computer. I found this C# project to be instructive. Ultimately I was able to get the following C# code to compile without errors:

      using System;
      using System.Collections.Generic;
      using System.IO;
      using System.Threading;
      using EOSDigital.API;
      using EOSDigital.SDK;

      namespace ConsoleExample
      {
      class Program
      {
      static CanonAPI APIHandler;
      static Camera MainCamera;
      static string ImageSaveDirectory;
      static bool Error = false;
      static ManualResetEvent WaitEvent = new ManualResetEvent(false);

          static void Main(string\[\] args)
          {
              CanonSDK.InitializeVersion();
      
              IntPtr camPtrList;
              CanonSDK.EdsGetCameraList(out camPtrList);
      
              int camCount;
              CanonSDK.EdsGetChildCount(camPtrList, out camCount);
              Console.WriteLine(camCount + " cameras found.");
          }
      }
      

      }

      However, I end up with camCount==0; "0 cameras found". I thought this might be because the EOS Utility (which opens automatically when plugging in the camera) is occupying the necessary resources, however I tried uninstalling EOS Utility and this did not help. Can anyone provide a simple example that I can test (that doesn't require Xcode) in VS or VScode? Any help or advice would be much appreciated. Thank you! PS: Figuring out how to compile in VS on mac was a struggle as I am unfamiliar with both, so I'm open to any suggestions for other IDEs/compilers/languages if it will make using EDSDK easier.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      I'm unfamiliar with Canon EDSDK however I found this article[^] on this very site; the article has lots of high votes, but please don't expect it to make your job simpler... :)

      Luc Pattyn [My Articles] If you can't find it on YouTube try TikTok...

      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