jtohmo Absent Member.
Absent Member.
2524 views

Add/Remove user from distribution list using C++ API

Hi!

I'm trying to add/remove users from a distribution list using the C++ API,
but I can't find any example on how to do this.

Can someone please help me with some sample code on how to do this?

Thanks
/Jeppe

Labels (1)
0 Likes
6 Replies
johnbaird Absent Member.
Absent Member.

Re: Add/Remove user from distribution list using C++ API

> I'm trying to add/remove users from a distribution list using the C++ API,
> but I can't find any example on how to do this.
>
> Can someone please help me with some sample code on how to do this?


Assuming that you are reasonably familiar with the GW Admin Object API, you
need to get the DL's members collection and use:

hr = pIADDLMembers->Add("insert parameters here" );

For deletion you have to get the individual member and use delete i.e.

hr = pIADDLMember->Delete( );

John
DevSup SysOp 24


0 Likes
jtohmo Absent Member.
Absent Member.

Re: Add/Remove user from distribution list using C++ API

John Baird wrote:

> > I'm trying to add/remove users from a distribution list using the C++ API,
> > but I can't find any example on how to do this.
> >
> > Can someone please help me with some sample code on how to do this?


> Assuming that you are reasonably familiar with the GW Admin Object API, you
> need to get the DL's members collection and use:


> hr = pIADDLMembers->Add("insert parameters here" );


> For deletion you have to get the individual member and use delete i.e.


> hr = pIADDLMember->Delete( );


> John
> DevSup SysOp 24


I could figure that out, but I don't understand the parameters to insert?
As far as I can see there should be an DIADAdminObject as first parameter?
What is that?

0 Likes
johnbaird Absent Member.
Absent Member.

Re: Add/Remove user from distribution list using C++ API


"jtohmo" <jeppe@myrealbox.com> wrote in message
news:Sst7g.2404$U_.2238@prv-forum2.provo.novell.com...
> John Baird wrote:
>
>> > I'm trying to add/remove users from a distribution list using the C++
>> > API,
>> > but I can't find any example on how to do this.
>> >
>> > Can someone please help me with some sample code on how to do this?

>
>> Assuming that you are reasonably familiar with the GW Admin Object API,
>> you
>> need to get the DL's members collection and use:

>
>> hr = pIADDLMembers->Add("insert parameters here" );

>
>> For deletion you have to get the individual member and use delete i.e.

>
>> hr = pIADDLMember->Delete( );

>
>> John
>> DevSup SysOp 24

>
> I could figure that out, but I don't understand the parameters to insert?
> As far as I can see there should be an DIADAdminObject as first parameter?
> What is that?


So you are not familiar with either the GW Admin Object API or COM? That
makes the job non-trivial. Do you really need to code this yourself? I'm not
trying to be discouraging, but having learned the GW Admin API only a couple
of years back, and knowing nothing of COM before that, I can diplomatically
state that this API is not for the faint-hearted!

I can provide more info if you you want to continue.

John
John


0 Likes
jtohmo Absent Member.
Absent Member.

Re: Add/Remove user from distribution list using C++ API

John Baird wrote:

> "jtohmo" <jeppe@myrealbox.com> wrote in message
> news:Sst7g.2404$U_.2238@prv-forum2.provo.novell.com...
> > John Baird wrote:
> >
> >> > I'm trying to add/remove users from a distribution list using the C++
> >> > API,
> >> > but I can't find any example on how to do this.
> >> >
> >> > Can someone please help me with some sample code on how to do this?

> >
> >> Assuming that you are reasonably familiar with the GW Admin Object API,
> >> you
> >> need to get the DL's members collection and use:

> >
> >> hr = pIADDLMembers->Add("insert parameters here" );

> >
> >> For deletion you have to get the individual member and use delete i.e.

> >
> >> hr = pIADDLMember->Delete( );

> >
> >> John
> >> DevSup SysOp 24

> >
> > I could figure that out, but I don't understand the parameters to insert?
> > As far as I can see there should be an DIADAdminObject as first parameter?
> > What is that?


> So you are not familiar with either the GW Admin Object API or COM? That
> makes the job non-trivial. Do you really need to code this yourself? I'm not
> trying to be discouraging, but having learned the GW Admin API only a couple
> of years back, and knowing nothing of COM before that, I can diplomatically
> state that this API is not for the faint-hearted!


> I can provide more info if you you want to continue.


> John
> John


I'm currently using the API to add/modify/delete users, and now I also
would like to be able to modify distribution lists. So, if you have an
example on how to add a user to a distribution list, thet might be enough,
at least I can try.

Jeppe

0 Likes
johnbaird Absent Member.
Absent Member.

Re: Add/Remove user from distribution list using C++ API


"jtohmo" <jeppe@myrealbox.com> wrote in message
news:pQ18g.3665$U_.1490@prv-forum2.provo.novell.com...
> John Baird wrote:
>
>> "jtohmo" <jeppe@myrealbox.com> wrote in message
>> news:Sst7g.2404$U_.2238@prv-forum2.provo.novell.com...
>> > John Baird wrote:
>> >
>> >> > I'm trying to add/remove users from a distribution list using the
>> >> > C++
>> >> > API,
>> >> > but I can't find any example on how to do this.
>> >> >
>> >> > Can someone please help me with some sample code on how to do this?
>> >
>> >> Assuming that you are reasonably familiar with the GW Admin Object
>> >> API,
>> >> you
>> >> need to get the DL's members collection and use:
>> >
>> >> hr = pIADDLMembers->Add("insert parameters here" );
>> >
>> >> For deletion you have to get the individual member and use delete i.e.
>> >
>> >> hr = pIADDLMember->Delete( );
>> >
>> >> John
>> >> DevSup SysOp 24
>> >
>> > I could figure that out, but I don't understand the parameters to
>> > insert?
>> > As far as I can see there should be an DIADAdminObject as first
>> > parameter?
>> > What is that?

>
>> So you are not familiar with either the GW Admin Object API or COM? That
>> makes the job non-trivial. Do you really need to code this yourself? I'm
>> not
>> trying to be discouraging, but having learned the GW Admin API only a
>> couple
>> of years back, and knowing nothing of COM before that, I can
>> diplomatically
>> state that this API is not for the faint-hearted!

>
>> I can provide more info if you you want to continue.

>
>> John
>> John

>
> I'm currently using the API to add/modify/delete users, and now I also
> would like to be able to modify distribution lists. So, if you have an
> example on how to add a user to a distribution list, thet might be enough,
> at least I can try.


The code is divvied into a number of functions, and I'd need to post quite
alot to be of use. But what you need to do is declare a DIADAdminObject
instead of a DIADUser - you should be familiar with DIADUser.
DIADAdminObject is a base class (that may not quite be the right term) of
DIADUser. So:

DIADAdminObject pDIADAdminObject = NULL;

pIADUsers->ItemByObjectID(TO_OLE_STRING(objectID),
(DIADUser **) &pDIADAdminObject);

Then use pDIADAdminObject as a parameter to pIADDLMembers->Add().

Hope this helps, John


0 Likes
jtohmo Absent Member.
Absent Member.

Re: Add/Remove user from distribution list using C++ API

John Baird wrote:

> "jtohmo" <jeppe@myrealbox.com> wrote in message
> news:pQ18g.3665$U_.1490@prv-forum2.provo.novell.com...
> > John Baird wrote:
> >
> >> "jtohmo" <jeppe@myrealbox.com> wrote in message
> >> news:Sst7g.2404$U_.2238@prv-forum2.provo.novell.com...
> >> > John Baird wrote:
> >> >
> >> >> > I'm trying to add/remove users from a distribution list using the
> >> >> > C++
> >> >> > API,
> >> >> > but I can't find any example on how to do this.
> >> >> >
> >> >> > Can someone please help me with some sample code on how to do this?
> >> >
> >> >> Assuming that you are reasonably familiar with the GW Admin Object
> >> >> API,
> >> >> you
> >> >> need to get the DL's members collection and use:
> >> >
> >> >> hr = pIADDLMembers->Add("insert parameters here" );
> >> >
> >> >> For deletion you have to get the individual member and use delete i.e.
> >> >
> >> >> hr = pIADDLMember->Delete( );
> >> >
> >> >> John
> >> >> DevSup SysOp 24
> >> >
> >> > I could figure that out, but I don't understand the parameters to
> >> > insert?
> >> > As far as I can see there should be an DIADAdminObject as first
> >> > parameter?
> >> > What is that?

> >
> >> So you are not familiar with either the GW Admin Object API or COM? That
> >> makes the job non-trivial. Do you really need to code this yourself? I'm
> >> not
> >> trying to be discouraging, but having learned the GW Admin API only a
> >> couple
> >> of years back, and knowing nothing of COM before that, I can
> >> diplomatically
> >> state that this API is not for the faint-hearted!

> >
> >> I can provide more info if you you want to continue.

> >
> >> John
> >> John

> >
> > I'm currently using the API to add/modify/delete users, and now I also
> > would like to be able to modify distribution lists. So, if you have an
> > example on how to add a user to a distribution list, thet might be enough,
> > at least I can try.


> The code is divvied into a number of functions, and I'd need to post quite
> alot to be of use. But what you need to do is declare a DIADAdminObject
> instead of a DIADUser - you should be familiar with DIADUser.
> DIADAdminObject is a base class (that may not quite be the right term) of
> DIADUser. So:


> DIADAdminObject pDIADAdminObject = NULL;


> pIADUsers->ItemByObjectID(TO_OLE_STRING(objectID),
> (DIADUser **) &pDIADAdminObject);


> Then use pDIADAdminObject as a parameter to pIADDLMembers->Add().


> Hope this helps, John

Thanks John!

I will try this out.

Regards
/Jesper

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.