Usage of ActionListener - C++ Toolkit
Hi everybody,
I'm new at this topic, so this is some newbie question. I want to know, how to use Actionlisteners. So i added a same example. There is a tester-class and beneath user_initialize(){} is the OnAfterModelDisplay methode. In user_initialize() i tried different things to get any respone in Creo. I thought i have to take something like the pointer wSession and call addactionlistener with a smartpointer to a Listener (what ever a listener is?!). But nothing worked.
The same problem i have with the other Actionlisteners, which need a methode-call addactionlistner.
Can somebody help me at this point and show me the right direction please. i really want to understand the whole concept of this. thank you!
<inculdes>
class tester : public pfcSessionActionListener
{
public:
tester(){} //default constructor
void OnAfterModelDisplay();
};
extern "C" int user_initialize(
int argc,
char *argv[],
char *version,
char *build,
wchar_t errbuf[80])
{
try
{
pfcSession_ptr Session = pfcGetProESession ();
wfcWSession_ptr wSession = wfcWSession::cast (Session);
wSession->AddActionListener(smartpointer to Listener );
return (wfcTK_NO_ERROR);
}
}
void tester::OnAfterModelDisplay()
{
try
{
//do something great
}
}
