c++ to c#... sip enumeration

E

Evan Camilleri

I found http://www.developer.com/ws/pc/article.php/3583686 where there is a
SIP enumeration! I would like it in C#... any help?

Basically the following is what is stopping me:


CTypedPtrMap<CMapStringToPtr,CString,CLSID*> g_SipMap;

int SipEnumIMProc(IMENUMINFO *pIMInfo)
{
CLSID* pCLSID = new CLSID;
memcpy(pCLSID,&pIMInfo->clsid,sizeof(CLSID));
g_SipMap.SetAt(CString(pIMInfo->szName),pCLSID);

TRACE(_T("%sn"),CString(pIMInfo->szName));

return 1;

}

void CSIPDemoDlg::OnButtonEnum()
{
SipEnumIM(SipEnumIMProc);

CString sSipName;
CLSID *pCLSID = NULL;
for (POSITION pos = g_SipMap.GetStartPosition(); pos; )
{
g_SipMap.GetNextAssoc(pos,sSipName,pCLSID);
m_SipList.AddString(sSipName);
}
}
Do not know if correct, I made the following definition in
c#:[DllImport("Coredll.dll")]static extern int SipEnumIM(IMENUMPROC
pEnumIMProc);struct IMENUMINFO{char[] szName;Guid clsid;}delegate int
IMENUMPROC(ref IMENUMINFO imenuinfo);Evan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top