#include <iostream>
using namespace std;

void my_callback( AmsAddr*, AdsNotificationHeader*, unsigned long );

// Wichtig: MyClass darf nicht kopierbar sein, weil sie ihre Adresse in
// einem Callback registriert!
class MyClass
{
	// "echter" Callback ist friend, damit er die private Methode aufrufen darf
	friend void my_callback( AmsAddr*, AdsNotificationHeader*, unsigned long );

public:
	MyClass()
	{
		AdsSyncAddDeviceNotificationReq( pAddr, 
										 ADSIGRP_SYM_VALBYHND, 
										 lHdlVar, 
										 &NotificationSettings, 
										 &my_callback,
										 *reinterpret_cast<unsigned long*>( this ),
										 &lHdlNotification);		
	}
	
	~MyClass()
	{
		// Callback wieder austragen!
	}
	
	
	MyClass( MyClass const& other ) = delete;
	MyClass( MyClass&& other ) = delete;
	
	MyClass& operator=( MyClass const& other ) = delete;
	MyClass& operator=( MyClass&& other ) = delete;
	

private:
	void OnCallback( AmsAddr* addr, AdsNotificationHeader* header )
	{
		// tadaaa	
	}
};

void my_callback( AmsAddr* addr, AdsNotificationHeader* header, unsigned long param )
{
	MyClass* instance = reinterpret_cast<MyClass*>( param );
	instance->OnCallback( addr, header );
}

int main() 
{
	// your code goes here
	return 0;
}