Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 543883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:35:49+00:00 2026-05-13T10:35:49+00:00

I don’t know much about dlls. I’m reading a book on COM. In which

  • 0

I don’t know much about dlls. I’m reading a book on COM. In which author is referring to something Exporting a function from a DLL. He tells how to do that but he doesn’t tell what is it or why it should be done?

The method he suggests is:
a) mark function with extern "C" (don’t know why?)
b) create a DEF file and add the function names in EXPORTS section of this DEF file. again no clue about why and what exactly is happening there?

Another thing that I don’t understand is term symbols/symbol table.

  1. What does Exporting a function from a DLL mean?
  2. What is symbols/symbol table?

I would be thankful if any one can explain me in simple , clear & detail terms. Any web links or tutorials are also highly welcomed.

EDIT:

I’ve used DLLs in .NET. In which I just include using namespace line and add the dlls to references and they work.This is the only way I know how to use dlls. I don’t know how using dll’s in .net is different from using them in COM. Can any one relate the .NET too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:35:49+00:00Added an answer on May 13, 2026 at 10:35 am

    DLLs in .NET are quite different to native DLLs. .NET DLLs contain bytecode, called CIL, which has enough information for other programs – such as the csc compiler – to work out the classes, types, interfaces etc that are contained within.

    This is quite different to native DLLs. Native DLLs contain binary instructions & mostly unstructured data, and there is (in general) no way to work out what the data means – for example somewhere in the DLL may be the two bytes (in hex) 43 23 and there’s no way to tell whether the program will interpret these as the characters C# or as the integer 17187 or a memory address, or even an instruction to feed to the CPU.

    So, moving on to your questions:

    1. The symbol table is a piece of metadata for the DLL; it tells the compiler/linker how to convert void myDllFunc (int bar) into an address in the DLL. It’s basically a look-up table. Exporting functions from the DLL is how you tell which functions you’d like to end up in that look up table – these are the functions that other code will be able to call, because it will be able to find them. Remember – without other information, there’s no way to tell where myDllFunc starts.
    2. extern C is recommended because of the process of name resolution, and in particular, how C++ handles function overloading. When you have two functions:
    int square (int x);
    double square (double x);
    

    the compiler needs some way to distinguish between them – the name “square” is now ambiguous, and can’t be resolved to a single code address. C++ handles this by name mangling – the compiler takes the name of your function, square, and then adds some magic strings corresponding to the types in the function signature. So, for example, the compiler could see your two functions as:

    int int+square+int (int x);
    double dbl+square+dbl (double x);
    

    and they’re now no longer ambiguous (real compilers don’t use such a simple scheme). There are now two problems here:

    1. You want to refer to that function as “square”, not “int+square+int”, and, worse,
    2. Different C++ compilers use different name-mangling rules.

    In order to make it easier to interoperate, people generally mark functions they export with extern C, which makes the compiler use C’s naming rules, in which the function’s name is not mangled.

    Edit to address comments:
    Declaring the function signatures extern C resolves the name mangling problem because C doesn’t have name mangling. C can get away without name mangling because declaring two functions

    int square (int x);
    double square (double x);
    

    is an error; the compiler/linker doesn’t have to – and won’t – handle that ambiguity.

    Exporting a function from a DLL is nothing more than adding the function to the symbol table. This makes it possible for code outside your DLL to call the function, because now external code can look up where the function starts. Thus, the function is “exported” in that other people can call it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know when to add to a dataset a tableadapter or a query
I don't understand where the extra bits are coming from in this article about
I don't know if anyone has seen this issue before but I'm just stumped.
I don't edit CSS very often, and almost every time I need to go
I don't want PHP errors to display /html, but I want them to display
I don’t think I’ve grokked currying yet. I understand what it does, and how
I don't remember whether I was dreaming or not but I seem to recall
I don't expect a straightforward silver bullet answer to this, but what are the
I don't want to take the time to learn Obj-C. I've spent 7+ years
I don't currently use ajax.net though I would be open to it if it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.