Thread: DLL function by ordinal

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    DLL function by ordinal

    Hello everyone,


    Just confused about DLL function by ordinal concept. Ordinal should be on the other part of by name.

    But to use DLL function by ordinal technique, we need,

    1. Write a .DEF file and write down function ordinal (index);
    2. Use LoadLibrary and GerProcAddress to get the function pointer than use the function.

    In (2), we still need to use function name as input parameter to GetProcAddress. So, my question is, DLL function by ordinal technique is not pure by ordinal, still need function name information?


    thanks in advance,
    George

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Read documentation carefully
    lpProcName
    [in] Pointer to a null-terminated string containing the function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks vart!


    You mean this?

    lpProcName
    [in] Pointer to a null-terminated string that specifies the function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero.

    http://msdn2.microsoft.com/en-us/library/ms683212.aspx

    Quote Originally Posted by vart View Post
    Read documentation carefully

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  4. Problem in exporting static function in win32 dll
    By dattaforit in forum Windows Programming
    Replies: 4
    Last Post: 12-04-2006, 12:03 PM
  5. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM