Skip to content

Instantly share code, notes, and snippets.

@ColonelThirtyTwo
Last active December 15, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ColonelThirtyTwo/5286862 to your computer and use it in GitHub Desktop.
Save ColonelThirtyTwo/5286862 to your computer and use it in GitHub Desktop.
class MyTest
{
public:
int a,b,c;
void test()
{
}
};
extern "C"
{
int testfunc()
{
return 42;
}
}
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
int main()
{
HMODULE dll = LoadLibrary("example_dll.dll");
if(dll == NULL)
{
abort();
}
FreeLibrary(dll);
return 0;
}
local ffi = require "ffi"
local dll = ffi.load("example_dll")
ffi.cdef "int testfunc()"
print(dll.testfunc())
os.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment