Dll entry points..

sorry for asking a easy question..
can i call a dll function using ordinal or entry points..
if not what is there use..Idea
[191 byte] By [AshishYadav] at [2007-12-16]
# 1
Hi,

If you are looking for something like DllMain which was an optional entry point in the pre-.NET days, then one option is to use static conctructors for the class. The code within the static constructor would get called as soon as the CLR loads the class.

Take a look for samples and more explanation here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfstaticconstructors.asp

Regards,
Vikram

Vikram at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Check out:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcreatingprototypesinmanagedcode.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconEntryPointObjectField.asp

You should be able to specify the ordinal in the alias part of the function declaration by prepending a pound sign (#) (I haven't tried this myself)

Another great source for p/invoke is declarations is http://www.pinvoke.net

Best regards,
Johan Stenberg

JohanStenberg at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...