Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import a DLL with C++ (Win32)

How do I import a DLL (minifmod.dll) in C++ ?

I want to be able to call a function inside this DLL. I already know the argument list for the function but I don't know how to call it.

Is there a way of declaring an imported function in C++ like in C# ?

like image 315
Kristina Brooks Avatar asked Dec 17 '09 15:12

Kristina Brooks


People also ask

How do I manually install a DLL?

Click Start > All Programs > Accessories and right-click on "Command Prompt" and select "Run as Administrator" OR in the Search box, type CMD and when cmd.exe appears in your results, right-click on cmd.exe and select "Run as administrator" At the command prompt, enter: REGSVR32 "PATH TO THE DLL FILE"


1 Answers

The c# syntax for declaring an imported function is not available in c++. Here are some other SO questions on how to use DLLs:

  • Explicit Loading of DLL
  • Compile a DLL in C/C++, then call it from another program
  • Calling functions in a DLL from C++
  • Call function in c++ dll without header
  • How to use dll's?
  • Is this a good way to use dlls? (C++?)
like image 113
luke Avatar answered Sep 21 '22 08:09

luke