473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

about external methods

following the C# specification:

"Use the extern modifier in a method declaration to indicate that the method is implemented externally. A common use of the extern modifier is with the DllImport attribute."

"When an external method includes a DllImport attribute, the method declaration must also include a static modifier."

Somebody can tell me or give me an example or url that shows me how implement extern modifier without the DllImport attribute ????? Is possible to use the extern modifier if the static modifier isn't ??

thanks
Nov 15 '05 #1
2 4481
thanks mattias

"Mattias Sjögren" <ma********************@mvps.org> wrote in message news:uG**************@TK2MSFTNGP12.phx.gbl...
Carlos,
Somebody can tell me or give me an example or url that shows me how implement extern modifier without the DllImport attribute ?????


Microsoft uses it to implement internalcall methods in the BCL. Check
out the Rotor sources at

http://sharedsourcecli.sscli.net/sou...i/clr/src/bcl/

Is possible to use the extern modifier if the static modifier isn't ??


Yes, for example System.Object.GetHashCode() is an instance method
declared extern.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 15 '05 #2
thanks mattias

"Mattias Sjögren" <ma********************@mvps.org> wrote in message news:uG**************@TK2MSFTNGP12.phx.gbl...
Carlos,
Somebody can tell me or give me an example or url that shows me how implement extern modifier without the DllImport attribute ?????


Microsoft uses it to implement internalcall methods in the BCL. Check
out the Rotor sources at

http://sharedsourcecli.sscli.net/sou...i/clr/src/bcl/

Is possible to use the extern modifier if the static modifier isn't ??


Yes, for example System.Object.GetHashCode() is an instance method
declared extern.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Noam Raphael | last post by:
Hello, I thought about a new Python feature. Please tell me what you think about it. Say you want to write a base class with some unimplemented methods, that subclasses must implement (or...
3
by: bba | last post by:
os:xp pro sp1 ie 6.2800.1106 For some reason any java scripts that refers to 'external' fails: example: external.menuArguments.document.body.style.zoom="100%"; error message:
4
by: Kyle Sheldon | last post by:
I'm currently working on a class "Course" and I'm getting an unresolved external error when trying to compile. I understand that unresolved externals are caused by declaration of methods that...
1
by: Brian Kendig | last post by:
I've got some questions about using an external javascript file, included via '<script type="text/javascript" src="mycode.js" ></ script>': (1) If I define a function "myFunction()" in the...
8
by: wangdaixing | last post by:
I am reading "Programming .NET Components" 2nd Edition by Juval Lowy, O'Reilly. In Appendix E, there is a chapter "Coding Practices" which I agree and practice mostly. However, there are a few...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.