Results 1 to 3 of 3

Thread: Declaring Constants From DLL

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Posts
    12

    Declaring Constants From DLL

    How would you declare constants from a .dll, so you can use it in your program.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Declaring Constants From DLL

    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!

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Declaring Constants From DLL

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width