Here is a sample of what I understand you want:
Your C++/CLI "wrapper":
Market.h:
#include <boost/function.hpp>
#include <boost/signals2.hpp>
class __declspec(dllexport) Market
{
private: boost::signals2::signal<void(double)> signalEvent;
public: void AddHandler(boost::function<void(double)> handler);
public: void Move(double value);
};
Market.cpp:
#include "Market.h"
#include <boost/function.hpp>
void Market::AddHandler(boost::function<void(double)> handler)
{
signalEvent.connect(handler);
}
void Market::Move(double value)
{
signalEvent(value);
}
And your native app, test.cpp:
#include <iostream>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include "Market.h"
class Investor
{
public: void move_handler(double value)
{
std::cout << (value >= 0 ? "Hey! I'm the best!" : "Wat! I'm losing my shirt! ") << std::endl;
}
};
int main()
{
Investor investor;
Market market;
boost::function<void(double)> move = boost::bind(&Investor::move_handler, &investor, _1);
market.AddHandler(move);
market.Move(+0.10);
market.Move(-0.10);
}
Results:
Hey! I'm the best!
Wat! I'm losing my shirt!
Hope this helps...