Administration

abirti Messages postés 31 Date d'inscription mardi 26 avril 2005 Statut Membre Dernière intervention 28 mai 2008 - 4 avril 2006 à 10:57
abirti Messages postés 31 Date d'inscription mardi 26 avril 2005 Statut Membre Dernière intervention 28 mai 2008 - 4 avril 2006 à 17:16
Bonjour,
j'ai trouvé un problème dans l'utilisation des fonctions SNMP en particulier dans l'appel de ces fonctions un message d'erreur apparaît:"error C2059: erreur de syntaxe : '__stdcall'".
En plus,j'ai un autre problème "appel non conforme d'une fonction membre static".
aidez-moi svp
merci
trééééééééééééééééés urgent!!!!!!!!!!!!!!!!!!!!!

3 réponses

ctx_man Messages postés 285 Date d'inscription mardi 28 décembre 2004 Statut Membre Dernière intervention 20 janvier 2013 3
4 avril 2006 à 13:34
Je vois pas comment faire pour t'aider si tu donne pas le code associer a ton erreure...

Le travail c'est la santé, ne rien faire c'est la préservé !!!
0
ebooserge Messages postés 137 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 16 juillet 2007 1
4 avril 2006 à 16:20
de plus, snmp n'est pas une api mais un protocol. donc tu dois probablement utiliser une api, win32 ou autre.
precise la si tu veux de l'aide
0
abirti Messages postés 31 Date d'inscription mardi 26 avril 2005 Statut Membre Dernière intervention 28 mai 2008
4 avril 2006 à 17:16
En fait, je veux utiliser le protocole SNMP
et voilà ce que j'ai fait:

//snmp_pdu.h

#pragma once
#include "mgmtapi.h"
#include "winsnmp.h"
#include "snmp.h"
#include
#include <string>


class snmp_pdu
{
private:
LPSTR lpAgentAddress;
LPSTR lpAgentCommunity;
int ntimeout;
int nretries;
RFC1157VarBindList variableBindings;
public:
snmp_pdu(LPSTR,LPSTR);
LPSNMP_MGR_SESSION ouvrir_session();
SNMPAPI_STATUS get_variable(LPSNMP_MGR_SESSION);
int obtenir_oid(char*string);
~snmp_pdu(void);
};


//snmp_pdu.cpp
#include "StdAfx.h"
#include ".\snmp_pdu.h"
#using <mscorlib.dll>
#define WINAPI __stdcall


snmp_pdu::snmp_pdu(LPSTR lpAgentAddress1,LPSTR lpAgentCommunity1)
{
lpAgentAddress=(LPSTR)SNMP_malloc(strlen(lpAgentAddress1));
strcpy(lpAgentAddress,lpAgentAddress1);
lpAgentCommunity1=(LPSTR)SNMP_malloc(strlen(lpAgentCommunity1));
strcpy(lpAgentCommunity,lpAgentCommunity1);
ntimeout=NULL;
nretries=NULL;
//ntimeout=WINAPI::SnmpGetTimeout(lpAgentAddress,NULL,NULL);
//nretries=WINAPI::SnmpGetRetry(lpAgentAddress,NULL,NULL);
variableBindings.list=NULL;
variableBindings.len=0;
}

LPSNMP_MGR_SESSION snmp_pdu::ouvrir_session()
{
LPSNMP_MGR_SESSION session;
if((session==WINAPI::SnmpMgrOpen(lpAgentAddress,lpAgentCommunity,ntimeout,nretries)==NULL))
return NULL;
return session;
}

snmp_pdu::obtenir_oid(char *string)
{
AsnObjectIdentifier reqObject;
if(!WINAPI::SnmpMgrStrToOid(string,&reqObject))
return 1;
else
{
variableBindings.len++;
if((variableBindings.list==(RFC1157VarBind *)SNMP_realloc(variableBindings.list,sizeof(RFC1157VarBind) * variableBindings.len)==NULL))
return 1;
variableBindings.list[variableBindings.len-1].name=reqObject;
variableBindings.list[variableBindings.len-1].value.asnType=ASN_NULL;
}
return 0;
}


snmp_pdu::~snmp_pdu()
{
delete(lpAgentAddress);
delete(lpAgentCommunity);
delete(&variableBindings);

}

je programme avec C++.Net.

Merci d'avance.
0
Rejoignez-nous