The extern modifier is used to declare a method that is implemented externally. A common use of the extern modifier is with the DllImport attribute when you are using Interop services to call into unmanaged code. In this case, the method must also be declared as static,
The extern keyword can also define an external assembly alias, which makes it possible to reference different versions of the same component from within a single assembly. For more information,Syntax:
private static extern void AVIFileInit();Example:
public static extern int MessageBox(IntPtr h, string m, string c, int type);
static int Main()
Console.Write("Enter your message: ");
myString = Console.ReadLine();
return MessageBox((IntPtr)0, myString, "My Message Box", 0);
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1399 / . Delta: 0.04239 с