Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 1.5 KB

exporting-functions-from-a-dll-by-ordinal-rather-than-by-name.md

File metadata and controls

23 lines (16 loc) · 1.5 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Exporting Functions from a DLL by Ordinal Rather Than by Name
Exporting Functions from a DLL by Ordinal Rather Than by Name
11/04/2016
exporting functions [C++], ordinal values
ordinal exports [C++]
exporting DLLs [C++], ordinal values
NONAME attribute
679719fd-d965-4df3-9f7a-7d86ad831702

Exporting Functions from a DLL by Ordinal Rather Than by Name

The simplest way to export functions from your DLL is to export them by name. This is what happens when you use __declspec(dllexport), for example. But you can instead export functions by ordinal. With this technique, you must use a .def file instead of __declspec(dllexport). To specify a function's ordinal value, append its ordinal to the function name in the .def file. For information about specifying ordinals, see Exporting from a DLL Using .def Files.

Tip

If you want to optimize your DLL's file size, use the NONAME attribute on each exported function. With the NONAME attribute, the ordinals are stored in the DLL's export table rather than the function names. This can be a considerable savings if you are exporting many functions.

What do you want to do?

See also

Exporting from a DLL