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

  • Home
  • SEARCH
  • 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 831835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:16:12+00:00 2026-05-15T04:16:12+00:00

How do I use functions from a DLL? I’m a total newbie and I

  • 0

How do I use functions from a DLL? I’m a total newbie and I don’t really understand how to use functions from a DLL file. I’m trying to use MS Visual Studio 2008 (C++).

My understanding is that the DLL files will have corresponding header files and as long as I include the header files and call the functions normally in my code, it should work? Is that correct? Then I would just need to have the compiled exe file be able to find the DLL?

Please let me know if that is a remotely correct understanding!

Thanks!

Russel

  • 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-15T04:16:13+00:00Added an answer on May 15, 2026 at 4:16 am

    To reuse a function declared in a DLL you have 2 choices:

    The first one (and preferable) is to include the corresponding header file declaring the function you want to use, and then linking to the corresponding .lib. This second step appears to be linking statically to the function, but in reality ends up being a stub call that will load the DLL to memory when the first function included in the corresponding DLL is called. For example, to use the CreateWindowEx function you include the “WinUser.h” header and link to the “User32.lib” library.

    The second option is to load the library manually. For this you would call the LoadLibrary function to get a handle to the DLL exporing the function you want, and then use GetProcAddress to get a pointer to the function. The returned pointer needs to be cast to the appropriate type, and then you then you can use it as any regular function pointer. This option is only recommended if you do not have access to the implementer’s header and library, because there is a risk of using incorrect parameters or a mismatched calling convention in your function declaration.

    PS – I’m simplifying a bit, but this is the core of how the process works.

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

Sidebar

Related Questions

I am trying to use several functions from kernal32.dll. However, when my application tries
I'm trying to debug a C/C++ native DLL project from Visual Studio 2010. I'm
Is there any better way to load and use functions from a DLL file
I started studying DLL's with implicit linking. I don't really fully understand how it
I have made a dll in Microsoft Visual Studio 2005. Then i am trying
Is it possible to use PHP's SimpleXML functions to create an XML object from
I'm trying to use the StringEscapeUtils.escapeXML() function from org.apache.commons.lang... There are two versions of
I have a C++ library and a C++ application trying to use functions and
I´m developing a software in C# that uses static functions from a C++ .dll
I have C# wrapper code that calls functions from a native (C++) dll. Currently,

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.