Originally Posted By: DLively
Edit: Which VC++ version should I have installed?

I'm going to lean myself out of the metaphorical window here, but I think you can choose whichever you want as long as you stay away from the engine SDK. If you stick to a C interface, and it's not like you actually have a choice here, the produced DLL should be ABI compatible with Lite-C.

The basic idea of a DLL is that you have code compiled into a different binary that is loaded at runtime and then linked at runtime. Normally when you write a function in Lite-C and then later call it, the target address is resolved when you compile your application. The difference with a DLL is that the target address is resolved at runtime, which means you have to import the functions from the DLL which will tell the compiler that the function does actually exist and is okay to call, it just is not visible yet, but it also puts an entry into your binary so the dynamic linker can load the DLL and resolve the targets for you at runtime.

Let's say your DLL exports a function called foobar which takes an int, you would then declare the function on the Lite-C side like this:

Code:
void foobar(int bar);
#define PRAGMA_API foobar;myDLL!foobar



You can also rename the function if you would like, the first part of PRAGMA_API is the identifier of the function in Lite-C, then comes the name of your DLL and then comes the identifier of the exported function.

Your callsites don't change, it still looks like this
Code:
foobar(42); // Call into the DLL



Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com