-1

I've try to connect in this way

TextStore

typedef boost::signals2::signal<VOID(TextStore*, RECT*)> signal_GetCompExt;
signal_GetCompExt       m_sigGetCompExt;

Signal Handler

delegate VOID GetCompsitionExtDelegate(TextStore* textStore, RECT* rect);
VOID onGetCompsitionExt(TextStore* textStore, RECT* rect);

Connect Signal

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()));

but it tells me

C2064   term does not evaluate to a function taking 2 arguments

https://github.com/Windmill-City/libtf/blob/master/libtfWrapper/AppWrapper.cpp

Set Boost Root before build

Path:TextServiceFramework\libtf\PropertySheet.props

BoostVersion boost_1_74_0

  • Fonund a post for this question: https://stackoverflow.com/questions/42304020/how-can-i-boostbind-to-a-member-of-a-managed-class-which-passes-and-returns-a – Windmill_City Aug 23 '20 at 11:56
  • sorry for the duplicate question, but i have search for connect delegate to signal, and i got nothing.... – Windmill_City Aug 23 '20 at 11:57

1 Answers1

0
typedef void (*GetCompExtCallback)(TextStore* ts, RECT* rect);
m_TextStore->m_sigGetCompExt.connect(reinterpret_cast<GetCompExtCallback>(Marshal::GetFunctionPointerForDelegate(gcnew GetCompsitionExtDelegate(this, &AppWrapper::onGetCompsitionExt)).ToPointer()));