wab - IID_IMAPITable->nicht aufgelöstes symbol
-
Hallo!
Ich arbeite gerade an einer integration von WAB (windows adress book) in mein programm.
das auslesen der daten und das löschen funktioniert mitleerweile (was ein s***** interface
)
nur beim erstellen eines neuen eintrages hab ich ein problem:
hr = lpContainer->OpenProperty(PR_CREATE_TEMPLATES, (LPIID)&IID_IMAPITable, 0, 0, (LPUNKNOWN *)&lpTPLTable);
er sagt mir beim kompilieren:
db COPY error LNK2001: Nichtaufgeloestes externes Symbol _IID_IMAPITable
obwohl ich die mapi32.lib drin hab und USES_IID_IMAPITable definiert hab...
hat es evtl. schon mal jemand geschafft einen eintrag ins wab zu bekommen? ich würde mich auch über alternativen code riesig freuen, denn im netz gibt es gar nix außer ein kleinen schnippsel von m$ aus dem ich das da oben hab.
-
es gibt noch eine andere lösung! und die funktioniert!
also was sich ms bei wab wohl gedacht hat???hier für die, die es interessiert: (war im beispiel wabtool)
enum { icrPR_DEF_CREATE_MAILUSER = 0, icrPR_DEF_CREATE_DL, icrMax }; const SizedSPropTagArray(icrMax, ptaCreate)= { icrMax, { PR_DEF_CREATE_MAILUSER, PR_DEF_CREATE_DL, } }; // Gets the WABs default Template ID for MailUsers // or DistLists. These Template IDs are needed for creating // new mailusers and distlists // HRESULT CWAB::HrGetWABTemplateID(ULONG ulObjectType, ULONG * lpcbEID, LPENTRYID * lppEID) { LPABCONT lpContainer = NULL; HRESULT hr = hrSuccess; SCODE sc = ERROR_SUCCESS; ULONG ulObjType = 0; ULONG cbWABEID = 0; LPENTRYID lpWABEID = NULL; LPSPropValue lpCreateEIDs = NULL; LPSPropValue lpNewProps = NULL; ULONG cNewProps; ULONG nIndex; if ( (!m_lpAdrBook) || ((ulObjectType != MAPI_MAILUSER) && (ulObjectType != MAPI_DISTLIST)) ) { hr = MAPI_E_INVALID_PARAMETER; goto out; } *lpcbEID = 0; *lppEID = NULL; if (HR_FAILED(hr = m_lpAdrBook->GetPAB( &cbWABEID, &lpWABEID))) { goto out; } if (HR_FAILED(hr = m_lpAdrBook->OpenEntry(cbWABEID, // size of EntryID to open lpWABEID, // EntryID to open NULL, // interface 0, // flags &ulObjType, (LPUNKNOWN *)&lpContainer))) { goto out; } // Opened PAB container OK // Get us the default creation entryids if (HR_FAILED(hr = lpContainer->GetProps( (LPSPropTagArray)&ptaCreate, 0, &cNewProps, &lpCreateEIDs) ) ) { goto out; } // Validate the properties if ( lpCreateEIDs[icrPR_DEF_CREATE_MAILUSER].ulPropTag != PR_DEF_CREATE_MAILUSER || lpCreateEIDs[icrPR_DEF_CREATE_DL].ulPropTag != PR_DEF_CREATE_DL) { goto out; } if(ulObjectType == MAPI_DISTLIST) nIndex = icrPR_DEF_CREATE_DL; else nIndex = icrPR_DEF_CREATE_MAILUSER; *lpcbEID = lpCreateEIDs[nIndex].Value.bin.cb; m_lpWABObject->AllocateBuffer(*lpcbEID, (LPVOID *) lppEID); if (sc != S_OK) { hr = MAPI_E_NOT_ENOUGH_MEMORY; goto out; } CopyMemory(*lppEID,lpCreateEIDs[nIndex].Value.bin.lpb,*lpcbEID); out: if (lpCreateEIDs) m_lpWABObject->FreeBuffer(lpCreateEIDs); if (lpContainer) lpContainer->Release(); if (lpWABEID) m_lpWABObject->FreeBuffer(lpWABEID); return hr; }
die gotos sind schön, oder???