To get a pointer to the GroupWise Application (Session) Interface, use:
hResult = CoCreateInstance(CLSID_GroupWare, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER, IID_IGWSession, (void **) &pIGWSession)
To log in to GroupWise from C++, use:
pIGWSession->Login(vUserId, vCmdLine, vPassword, vWhenToPrompt, vReserved, &pDIGWAccount)
To get the Root Account's Interface from the Dispatch Interface:
pDIGWAccount->QueryInterface(IID_IGWAccount, (LPVOID *) &pIGWAccount)
After importing the type library, use:
GroupwareTypeLibrary.Application objApplication - new GroupwareTypeLibrary.Application(); GroupwareTypeLibrary.Account vAccount = objApplication.Login("","","","","");
MessageBox.Show(vAccount.Owner.DisplayName);