
Signature
---------------------------------------
Knock you down in first round
Dont hesitate while asking any question.. this is public world, ask any thing
you want to learn, dont hesitate.
Secondly, extern key word is used when you wanted to import any assembly out
side your scope, ie., not within the application.
Inother words, the dlls which are already created and you have a situation
to use them at run time, then take the assistance from Extern key word
Exmaple from MSDN
[DllImport("avifil32.dll")]
private static extern void AVIFileInit();

Signature
Every thing is perfect, as long as you share!!!
> Hi,
>
> Am a novice in c#, tell me about how and where i can use "Extern" Keyword
> with some good example
>
> Thansk
Jon Skeet [C# MVP] - 07 May 2007 20:26 GMT
> Dont hesitate while asking any question.. this is public world, ask any thing
> you want to learn, dont hesitate.
>
> Secondly, extern key word is used when you wanted to import any assembly out
> side your scope, ie., not within the application.
It's almost never used for *assemblies* (which are managed code) - it's
almost alwyas used for using functions in unmanaged libraries.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Brian Schwartz - 08 May 2007 18:48 GMT
A common use of it is for the Windows API. I have a class that contains
declarations like this:
internal static class API
{
[DllImport("user32.dll")]
internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, UIntPtr
wParam, IntPtr lParam);
}

Signature
Brian Schwartz
FishNet Components
http://www.fishnetcomponents.com
Fish Grid .NET Light: Powerful Layouts for Small Datasets