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. marshalling

marshalling

Scheduled Pinned Locked Moved C#
question
5 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.
  • G Offline
    G Offline
    grv575
    wrote on last edited by
    #1

    What size should I use to get an equivalent C struct for the type bool? i.e. struct { DWORD a; bool b; } s; would be struct s { int a; // bool a; or char a; or byte a; ? } ...what's the best way to marshal C bools?

    L 1 Reply Last reply
    0
    • G grv575

      What size should I use to get an equivalent C struct for the type bool? i.e. struct { DWORD a; bool b; } s; would be struct s { int a; // bool a; or char a; or byte a; ? } ...what's the best way to marshal C bools?

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

      grv575 wrote: ...what's the best way to marshal C bools? bool is not a C data type. Look at the typedef of it.

      leppie::AllocCPArticle(Generic DFA State Machine for .NET);

      G 1 Reply Last reply
      0
      • L leppie

        grv575 wrote: ...what's the best way to marshal C bools? bool is not a C data type. Look at the typedef of it.

        leppie::AllocCPArticle(Generic DFA State Machine for .NET);

        G Offline
        G Offline
        grv575
        wrote on last edited by
        #3

        unsigned char or int? :) What's more common (VC 6 i guess, if anyone can check)

        L 1 Reply Last reply
        0
        • G grv575

          unsigned char or int? :) What's more common (VC 6 i guess, if anyone can check)

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

          What does it say in the header file? It all depends how that implementation is defining it.

          leppie::AllocCPArticle(Generic DFA State Machine for .NET);

          G 1 Reply Last reply
          0
          • L leppie

            What does it say in the header file? It all depends how that implementation is defining it.

            leppie::AllocCPArticle(Generic DFA State Machine for .NET);

            G Offline
            G Offline
            grv575
            wrote on last edited by
            #5

            Wish I knew. I deleted VS6 and am not keen on reinstalling it. In any case I'm almost certain it's typedef int bool or typedef enum { false, true } bool. Either way, it looks like I need a dword size field.

            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