Last active
December 15, 2015 16:09
-
-
Save ColonelThirtyTwo/5286862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyTest | |
{ | |
public: | |
int a,b,c; | |
void test() | |
{ | |
} | |
}; | |
extern "C" | |
{ | |
int testfunc() | |
{ | |
return 42; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WINDOWS_LEAN_AND_MEAN | |
#include <windows.h> | |
int main() | |
{ | |
HMODULE dll = LoadLibrary("example_dll.dll"); | |
if(dll == NULL) | |
{ | |
abort(); | |
} | |
FreeLibrary(dll); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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