SHOW:
|
|
- or go back to the newest paste.
| 1 | - | /* Replace "dll.h" with the name of your header */ |
| 1 | + | #ifndef _DLL_H_ |
| 2 | - | #include "dll.h" |
| 2 | + | #define _DLL_H_ |
| 3 | - | #include <windows.h> |
| 3 | + | |
| 4 | - | #define SIMBA_EXPORT _declspec(dllexport) __stdcall |
| 4 | + | #if BUILDING_DLL |
| 5 | # define DLLIMPORT __declspec (dllexport) | |
| 6 | - | extern "C" {
|
| 6 | + | #else /* Not BUILDING_DLL */ |
| 7 | - | |
| 7 | + | # define DLLIMPORT __declspec (dllimport) |
| 8 | - | int SIMBA_EXPORT addC(int a) //test func |
| 8 | + | #endif /* Not BUILDING_DLL */ |
| 9 | - | {
|
| 9 | + | |
| 10 | - | a = a + 1; |
| 10 | + | |
| 11 | - | return a; |
| 11 | + | static __stdcall int a(void); |
| 12 | - | } |
| 12 | + | static __stdcall int GetFuncCount(void); |
| 13 | - | } |
| 13 | + | static __stdcall int GetFuncInfo(int x, void **addr, char **def); |
| 14 | ||
| 15 | - | static __stdcall int a(void) |
| 15 | + | int GetFunctionCount(void) __attribute__((alias("GetFuncCount@0")));
|
| 16 | int GetFunctionInfo(int x, void **addr, char **def) __attribute__((alias("GetFuncInfo@12")));
| |
| 17 | - | return 42; |
| 17 | + | |
| 18 | - | } |
| 18 | + | /*class DLLIMPORT DllClass |
| 19 | {
| |
| 20 | - | static __stdcall int GetFuncCount(void) |
| 20 | + | public: |
| 21 | DllClass(); | |
| 22 | - | return 1; |
| 22 | + | virtual ~DllClass(void); |
| 23 | - | } |
| 23 | + | |
| 24 | private: | |
| 25 | - | static __stdcall int GetFuncInfo(int x, void **addr, char **def) |
| 25 | + | |
| 26 | }; */ | |
| 27 | - | switch (x) {
|
| 27 | + | |
| 28 | - | case 0: |
| 28 | + | |
| 29 | - | *addr = (void *)&a; |
| 29 | + | #endif /* _DLL_H_ */ |