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. Please Help : Marshalling in C#?

Please Help : Marshalling in C#?

Scheduled Pinned Locked Moved C#
helpcsharpquestion
3 Posts 3 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.
  • E Offline
    E Offline
    E6AD
    wrote on last edited by
    #1

    Dear All, I have the following issue... I need to call a function from an unmanaged dll... One of its input parameters is described as follows; CvContourRetrievalMode as the datatype name and it takes one of four values{CV_RETR_TREE...etc} so shall I define it as enum or what?in msdn I found only examples for strings,structs and classes?any suggestions? Thanks and Best Regards, E.A.

    L M 2 Replies Last reply
    0
    • E E6AD

      Dear All, I have the following issue... I need to call a function from an unmanaged dll... One of its input parameters is described as follows; CvContourRetrievalMode as the datatype name and it takes one of four values{CV_RETR_TREE...etc} so shall I define it as enum or what?in msdn I found only examples for strings,structs and classes?any suggestions? Thanks and Best Regards, E.A.

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      An enum will work fine. The important bit is that your datatype is the same size as the expected datatype. xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

      1 Reply Last reply
      0
      • E E6AD

        Dear All, I have the following issue... I need to call a function from an unmanaged dll... One of its input parameters is described as follows; CvContourRetrievalMode as the datatype name and it takes one of four values{CV_RETR_TREE...etc} so shall I define it as enum or what?in msdn I found only examples for strings,structs and classes?any suggestions? Thanks and Best Regards, E.A.

        M Offline
        M Offline
        Mohamad Al Husseiny
        wrote on last edited by
        #3

        Look at http://www.pinvoke.net/default.aspx/Enums.DFS_VOLUME_STATE[^] This an example may be help tou to convert your enum If you look at the left side from this page you will see many Enums you can look at them MCAD

        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