Open c8jiang opened 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.
auto f = sm.get_mem_fn<alias, void(Callback)>("set_callback");
My prject file: test_class.zip
My class like this: #include <iostream> #include <functional> #include <boost/config.hpp>
#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; };
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();
static std::size_t size();
std::string name() const;
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.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;
};