Extern Win32 API and structures

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ondrej Sevecek

    #1

    Extern Win32 API and structures

    Hello,
    I want to use some Win32 API call which itself uses some structure types a
    input/output parameters. I would use "extern" and "DllImport" manually, but
    this would expose a lot of work for me - struct redefinitions.
    Is there any simple method to import structure types from C++ .H files
    into C# code or is there some predefined class containing the whole Win32
    API stubs so I wouldn't have to define them myself?

    Ondra.



  • Mattias Sjögren

    #2
    Re: Extern Win32 API and structures

    [color=blue]
    > Is there any simple method to import structure types from C++ .H files
    >into C# code[/color]

    No, that's not trivial at all.

    [color=blue]
    >or is there some predefined class containing the whole Win32
    >API stubs so I wouldn't have to define them myself?[/color]

    Not in the framework, but there are some projects online that try to
    do this. Here's one for example:





    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    • Mattias Sjögren

      #3
      Re: Extern Win32 API and structures

      [color=blue]
      > Is there any simple method to import structure types from C++ .H files
      >into C# code[/color]

      No, that's not trivial at all.

      [color=blue]
      >or is there some predefined class containing the whole Win32
      >API stubs so I wouldn't have to define them myself?[/color]

      Not in the framework, but there are some projects online that try to
      do this. Here's one for example:





      Mattias

      --
      Mattias Sjögren [MVP] mattias @ mvps.org

      Please reply only to the newsgroup.

      Comment

      Working...