Shedding Light on windows Programming Home Training Resources Registration About the Paul Yao Company
The Paul Yao Company
P/Invoke Wizard Home

The PInvoke Wizard
PInvoke Programming
3. Required PInvoke References
To enable a successful compile, your managed code must reference the namespace which contains the PInvoke declarations. This means, of course, the System.Runtime.InteropServices namespace. Here is the declaration for C# and Visual Basic .NET code.


Your C# code needs a statement like the following:

// [C#] required declaration using System.Runtime.InteropServices; The corresponding statement in Visual Basic.NET is as follows:
' [VB] required declaration Imports System.Runtime.InteropServices



Last updated: October 25, 2023
By: Paul Yao
The Paul Yao Company

CONTACT US LOGISTICS REQUEST MORE INFORMATION