Import a DLL with C++ (Win32)

前端 未结 3 1882
萌比男神i
萌比男神i 2020-12-09 10:28

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

3条回答
  •  青春惊慌失措
    2020-12-09 10:51

    If the DLL includes a COM type library, you can use the #import statement as such:

    #import dllname.dll
    

    Otherwise, you'll need to link with an import library, and you'll need to provide a function prototype for your compiler. Typically the import library and a header file with the prototypes are provided by the DLL developer. If you're not, they can be very difficult to produce - unless you already know the argument list for the function, which you say you do. Instructions can be found here, amongst other places.

提交回复
热议问题