ARTICLE AD BOX
I want to use a DLL in my project. My current problem is that I only have the DLL itself, no headers, SDK or anything like that. I am aware that GetProcAddress can be used to call functions at runtime, but I'm trying to get this to work at compile time.
I think the first half of that process is easy enough to find, such as here. You create an export file with the following in it then use lib.exe to create the needed lib and exp files:
LIBRARY <DLL name> EXPORTS FriendlyName1=_DllFunc1@8 FriendlyName2=_DllFunc2@0 ...It's the second half of that process I have found little info on: Creating a header file and correctly declaring the functions. I have learned that besides the usual, you do need to add the correct calling convention to your declarations. So something like this:
#ifndef DLL_FUNCS_H #define DLL_FUNCS_H __stdcall int FriendlyName1(int arg1, int arg2); __stdcall int FriendlyName2(); #endifI get the feeling that I need more than this. Is this in fact all you need to invoke DLL functions, or does the header file need more than this?
