Is there a tool that generates P/Invoke signatures for arbitrary unmanaged DLL?

后端 未结 6 1629
失恋的感觉
失恋的感觉 2020-12-13 00:17

I stumbled upon a tool that generates P/Invoke signatures for Microsoft\'s own unmanaged DLLs: PInvoke Interop Assistant

Is there a similar tool that will generate P

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 01:00

    I use PInvoke Interop Assistant for unmanaged DLLs by using the third tab in the UI, marked "SigImp Translate Snippet". Simply copy-and-paste your header into the "Native Code Snippet" window and press Generate (or turn on Auto Generate). As an illustration here's some code from a question of mine. Note that for some reason errors don't appear in the Error panel but as comments at the top of the generated code.

    As several people have already said, the generated code should be used as a guide - you may well have to make changes to get exactly what you want.

    enter image description here

提交回复
热议问题