问题描述
我尝试以这种方式连接
TextStore
public class UpdateProfile:BaseModel
{
public string firstName { get; set; }
public string lastName { get; set; }
public IFormFile Image { get; set; }
}
信号处理程序
typedef boost::signals2::signal<VOID(TextStore*,RECT*)> signal_GetCompExt;
signal_GetCompExt m_sigGetCompExt;
连接信号
delegate VOID GetCompsitionExtDelegate(TextStore* textStore,RECT* rect);
VOID onGetCompsitionExt(TextStore* textStore,RECT* rect);
但它告诉我
using namespace System::Runtime::InteropServices;
m_TextStore->m_sigGetCompExt.connect(reinterpret_cast<TextStore::signal_GetCompExt::slot_type*>(Marshal::GetFunctionPointerForDelegate(gcnew GetCompsitionExtDelegate(this,&AppWrapper::onGetCompsitionExt)).ToPointer()));
https://github.com/Windmill-City/libtf/blob/master/libtfWrapper/AppWrapper.cpp
在构建前设置Boost Root
路径:C2064 term does not evaluate to a function taking 2 arguments
BoostVersion boost_1_74_0
解决方法
typedef void (*GetCompExtCallback)(TextStore* ts,RECT* rect);
m_TextStore->m_sigGetCompExt.connect(reinterpret_cast<GetCompExtCallback>(Marshal::GetFunctionPointerForDelegate(gcnew GetCompsitionExtDelegate(this,&AppWrapper::onGetCompsitionExt)).ToPointer()));