apolukhin / Boost.DLL

Library for comfortable work with DLL and DSO
https://boost.org/libs/dll
110 stars 69 forks source link

smart_library.get_mem_fn failed to call with 64bit dll #47

Open c8jiang opened 5 years ago

c8jiang commented 5 years ago

Environment: Windows 10 1903; MSVC 14.2; Boost 1.70 A member function in my class was successfully imported only in x86 and failed in x64.

auto f = sm.get_mem_fn<alias, void(Callback)>("set_callback"); give me an exception in x64. image

My prject file: test_class.zip

My class like this: #include <iostream> #include <functional> #include <boost/config.hpp>

struct CallbackInfo { void* p; int a; int b; void* pContext; }; //using Callback = std::function<void(CallbackInfo* pInfo)>; typedef void(__stdcall* Callback)(CallbackInfo* pInfo); class BOOST_SYMBOL_EXPORT test_a { int _a; public: test_a(); test_a(int a); ~test_a(); void print(); bool large_than(int a); const char* number(); void set_callback(Callback callback); static std::size_t size(); std::string name() const; };