Novell is now a part of Micro Focus

In the GroupWise Administrative APIs, would you be...

Articles and Tips: qna

01 Dec 2001


Q.

In the GroupWise Administrative APIs, would you be able to give me the format of the Connect string when I use ConnectByDN(String XX)?

A.

If you look at the gwadapi.h header file, you will see that the ConnectByDN method takes one required parameter (the DN or Distinguished Name), and one optional parameter (the Tree). The first argument is of type BSTR, and the second is a VARIANT string type. Hence, something like this should work (using both parameters).

//Connect to server
char* szDomDN, *szNDSTre;
VARIANT MyTree;
BSTR MyDom;
szNDSTre = "SERVER-1-TREE";    // tree
// the next line shows the format of "my" distinguished name in the directory
szDomDN  = "GWDomain.GroupWise.novell";  // distinguished name.
VariantInit (&MyTree);
V_VT(&MyTree) = VT_BSTR;
V_BSTR(&MyTree) = SysAllocString(TO_OLE_STRING(szNDSTre));
MyDom = SysAllocString(TO_OLE_STRING(szDomDN));
//  I assume you already have the pIGWSystem Interface pointer.
if(!SUCCEEDED(pIGWSystem->ConnectByDN(MyDom, MyTree))) 
{
printf("Failed to connect\n");
return -1;
}

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates