C++ handler_registration

Dejan Bojic <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Sorry for previous message...

I'm trying to make a little SNMP subagent using C++ (only one scalar value).  
I added a class, witch have a method init_, used for function for handler registration... 

Function call:
netsnmp_register_scalar(netsnmp_create_handler_registration  ("shelfSize", handle_ShelfSize,  shelfSize_oid,  OID_LENGTH(shelfSize_oid), HANDLER_CAN_RONLY));

And if I declare this function handle_ShelfSize  in the class I got this error message:

ShelfSize.cpp:39: error: argument of type 'int (CShelfInfo::)(netsnmp_mib_handler*, netsnmp_handler_registration*, netsnmp_agent_request_info*, netsnmp_request_info*)' does not match 'int (*)(netsnmp_mib_handler*, netsnmp_handler_registration*, netsnmp_agent_request_info*, netsnmp_request_info*)'
make: *** [msanShelfSize.o] Error 1

But, if I declare this function, out of class, like global function,  I don't get any errors, and SNMP subagnet work fine...  But this is not that I want...

I guess that problem is in that the C++ pointer to a class member function is
different from a pointer to a C function, but I don't know how to fix this. If somebody has any idea....

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.