Exemple d'erreurs:
Dans le fichier "ficher.h" du projet DLL, j'ai les fonctions suivantes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
//==============================================================================
// FUNCTION: HashKey<KEY>
// PURPOSE: Default hash key generator.
template<class KEY>
inline UINT HashKey(const KEY& cKey)
{
return ((UINT)(void*)(DWORD)cKey) >> 4;
}
//==============================================================================
// FUNCTION: HashKey<LPCTSTR>
// PURPOSE: String hash key generator.
template<>
inline UINT HashKey<LPCTSTR> (const LPCTSTR& tsKey)
{
LPCTSTR key = tsKey;
if (key == NULL) return -1;
UINT nHash = 0;
while (*key)
nHash = (nHash<<5) + nHash + *key++;
return nHash;
}
//==============================================================================
// FUNCTION: HashKey<COpcString>
// PURPOSE: String object hash key generator.
template<>
inline UINT HashKey<COpcString> (const COpcString& cKey)
{
LPCTSTR key = cKey;
if (key == NULL) return -1;
UINT nHash = 0;
while (*key)
nHash = (nHash<<5) + nHash + *key++;
return nHash;
}
bool RemoveKey(const KEY& cKey)
{
UINT uBin = HashKey(cKey)%m_uTableSize;
} |
L'erreur est:
1 2
|
error C2668: 'HashKey' : ambiguous call to overloaded function c:\my folder\ficher.h 234 |
Autre Question:
est ce que je peux utliser les fonctions exportées de ma dll native dans un nouveau projet VC++ 2005(c'est la version team edition )
comment je peux le faire? comment ajouter sa référence?
En fait j'ai fait un nouveau projet et je voulais ajouter la référence de ma dll, j'obtient le message suivant
Could not add a reference to file MaDLL.dll because it neither a .NET assemply or registered Acivex control
Partager