How would you declare constants from a .dll, so you can use it in your program.
Printable View
How would you declare constants from a .dll, so you can use it in your program.
If constant inside dll is marked public , then try using fully qualified name like :
assemblyname.namespace.classname to get constant name.I've not tested it though!
Are you talking about constants for use in calling Windows API functions? If so then you just declare them as you would any constant. They're just numbers. You can get their values from the API Viewer or PInvoke.net, amongst other places.
If that's not what you mean, but rather you're talking about constants declared in .NET assemblies, then they are just like any other members of managed types and you access them the same way you do any other member of a managed type.
I just noticed your name and realised you're the same person from that MPQ thread or whatever it was. In that case the first paragraph above applies but, obviously, these constants aren't part of the Windows API so you won't get their values from those places. You should be able to get the values from either the documentation for your DLL or the header file (.h extension) that they hopefully make available to clients.