Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How can I convert c++ into c#?

Solved1.44K views15th July 2021C++
2
Ana Pinho [SLC] [DevOps Advocate]1.33K 29th July 2020 0 Comments

I’m working on the AppearTv x20 Platform driver and my task was to implement a table with the services from the transcoder that you can see in the picture.  However, I encountered an issue. When I looked into the response of GetMultiServices() it was missing that yellow part. I looked into other calls and found out that this data was on GetServiceStatus(). I asked AppearTv x20 how I could link the two the responses.
They told me to look into the GetMultiServices, but also to look into the result from multiServiceProfile/GetMultiServiceProfiles.
In each multiservice there is a profile ID, to be matched to the uuid/key of a MultiServiceProfile.
Inside the profile there is a list of subservices, and the “index” variable is the one that is combined with the multiservice uuid/key.

This combination between the multiservice uuid/key and index is done in c++:

boost::uuids::name_generator gen(multiservice-uuid);

coderservice-uuid = gen(to_string(index));

It will give me a key that I can find in GetCardAllocations and match it with GetServiceStatus and get the data that I want.

My issue is how to use that c++ code in my driver and how to translate it to c#.

Ana Pinho [SLC] [DevOps Advocate] Selected answer as best 15th July 2021

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
5
Laurens Vergote [SLC] [DevOps Advocate]368 Posted 29th July 2020 1 Comment

I believe there are 2 ways to tackle this:

  1. Find or implement something that executes the same logic in C#
  2. Import the C++ dlls and use the [DllImport] attribute to call the methods from the c++ library. This does require you to know which dll contains the required method(s)
Ana Pinho [SLC] [DevOps Advocate] Selected answer as best 15th July 2021
Jan Staelens [SLC] [DevOps Advocate] commented 29th July 2020

Concerning the 2nd way, I can add an example taken from an older driver the iDirect iSite.

<QAction id="52" name="Manual Login" encoding="csharp" triggers="52" dllImport="MyCPPDll_1-0-0-4.dll"

then in the code:

public class Proxy
{
public static void Login(string username, string password, string ip, int port, int timeout, bool secureConnection, out string result, out string errorResult)
{ … my code…
Login(username, password, ip, port, timeout, secureConnection, out Result, out ErrorResult);
}

[DllImport("MyCPPDll_1-0-0-4.dll")]
extern static void Login(string username, string password, string ip, int port, int timeout, bool secureConnection, out IntPtr result, out IntPtr errorResult);

}

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs