Meilleur auteur de réponses
la dernière conversion

Question
-
bonjour
Toujours dans ma migration j'ai une nouvelle erreur que je ne comprend pas
il s'agit cette fois du code qui attaque la base de données
Je vous donne les déclarations des classes
class ElementLinks { public: int linksId; int linksSrc; int idParagraph; }; class ElementSemantic { public: stUnivers Univers; std::wstring wsText; std::wstring wsIdentifier; int siIdOccurence; int nuIdTypeElement; int siNbChunk; int nuIdParagraph; int nuIdChunk; int nuIdElemn; int nuIdChunkType; int siNbWord; int nuIdDrivingPos; std::wstring wsWord; int iValWord; int iIdDoc; int iPOS; std::list<ElementLinks*> Link; };
Je vous donne le code avec les lignes en erreur en numérotées//-------------------------------------------------------------------------------------------------------------------------------- //Name GetSegmentChunkOfSegment //Role Get the identifier list of the chunks of this segment order by the next and previous links //Interface //In hidSegmentID Identifier of the segment //In/Out ListChunkID Identifier list of the chunks of this segment //Result erc error return code //Constraints Element are added at the back of the ListChunkID //Resources //PreCondition //-------------------------------------------------------------------------------------------------------------------------------- std::list<ElementLinks> getLinks( ElementSemantic Enreg, int indice) { std::wstringstream wssRequest; unsigned long dwNbResultFound = 0; bool bEndReached; hidDB hidTemp; try { hidDB ErrorCode = 0; std::wstring wsOldText = L""; wssRequest << L"SELECT EL.nuIdElemnSrc, EL.nuIdElemnLink, EL.nuIdParagraph" << L" FROM T_ELEMENT_LINKS EL" << L" WHERE EL.nuIdElemnSrc = " << indice << L" ORDER BY EL.nuIdElemnLink"; dwNbResultFound = 0; ErrorCode |= objInterbaseManager.ExecuteSelectRequest(wssRequest.str(), &dwNbResultFound); if(dwNbResultFound == 0) { 3431 return( ErrorCode); } // STORE the link identifier for the identifier indice] ErrorCode |= objInterbaseManager.First(); bEndReached = false; while ((bEndReached != true) && (ErrorCode == INIT_NO_ERROR)) { // Get the result of the current request ElementLinks* pLink; pLink = new ElementLinks(); ErrorCode |= objInterbaseManager.GetHidDB(0,(int64_t&)hidTemp); // nuIdElemnLink pLink->linksId = hidTemp; ErrorCode |= objInterbaseManager.GetHidDB(1,(int64_t&)hidTemp); // nuIdElemnSrc pLink->linksSrc = hidTemp; ErrorCode |= objInterbaseManager.GetHidDB(2,(int64_t&)hidTemp); // nuidParagraph pLink->idParagraph = hidTemp; // Add the result of the current request in the Map list Enreg.Link.push_back( pLink); // Go to the next result of the request ErrorCode |= objInterbaseManager.Next(bEndReached); }// while } catch(...) { ; } 3459 return( Enreg.Link); }
je ne comprend pas l'origine de ces messages?
Jean Noël Martin
Réponses
-
Bonjour,
La variable ErrorCode est de type "hidDB". Votre fonction doit retourner une liste de type "std::list<ElementLinks>".
A la ligne 3459, vous retournez une liste de type "std::list<ElementLinks*>" alors que votre fonction attend une liste de type "std::list<ElementLinks>".
Cordialement
Gilles TOURREAU - MVP C#
Architecte logiciel/Consultant/Formateur Freelance - P.O.S Informatique
Blog : http://gilles.tourreau.fr - Suivez-moi sur Twitter
- MCPD : Enterprise Developper / Windows Developper 3.5 / ASP .NET 3.5/4.0
- MCSA : SQL Server 2012
- MCITP : SQL Server 2008 Developper
- MCTS : ADO .NET 3.5 / SQL Server 2008 Developper / Windows Forms 3.5 / ASP .NET 3.5/4.0 / TFS 2010 / Windows Azure- Marqué comme réponse JeanNoel53 lundi 14 octobre 2013 23:19