Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: 29 May 2006 05:43:59 -0700,    group: microsoft.public.exchange2000.general        back       


Extended MAPI GetMailboxTable problem   
hi,
here is my problem statement:

I am using Extended MAPI with c# (I have MAPI33 Wrapper) to log on to
an exchange server from my local machine and then loop through all the
mailboxes there (accessing some required mailboxes properties)

I create a session : MAPI.LogonEx(IntPtr.Zero, null, null,
MAPI.FLAGS.Extended | MAPI.FLAGS.LogonUI | MAPI.FLAGS.NewSession |
MAPI.FLAGS.ExplicitProfile, out session);
The profile i submit was created with my supplying the Exchange Server
name in the Profile Creation wizard ( I hope thats the correct thing to
do!!)

then :
IMAPITable mailboxTable = null;
IExchangeManageStore mngStore = null;
hr =
mngStore.GetMailboxTable("/cn=Configuration/cn=Servers/cn=addevdc01.devtenethealth.net",
out mailboxTable, 0);
if (hr != Error.Success) throw new Exception("Error: "+ hr.ToString());
Tags[] itags = new Tags[] {Tags.PR_ENTRYID, Tags.PR_LAST_LOGON_TIME,
Tags.PR_DISPLAY_NAME};
mailboxTable.SetColumns(itags, IMAPITable.FLAGS.Default);


hr = mailboxTable.QueryRows(2, 0, out rows);
if (hr != Error.Success) throw new Exception("Error: "+ hr.ToString());
mailboxTable.Dispose();


but obviously, I get "object reference not set to iunstance of an
object"  error while calling GetMailboxTable since, mngStore object is
not initialised.

How can i overcome this? and get a list of all mailboxes on my remote
server
Just another thing to check is the ServerDN is pass through in the
GetMailboxTable??? I hope that is correct too!!!!
date: 29 May 2006 05:43:59 -0700   author:   tarun

Re: Extended MAPI GetMailboxTable problem   
I also understand that before calling GetMailboxTable , i need to call
hr = session.GetMsgStoresTable(0, out tblMsgStores); //  tblMsgStores
is IMAPITABLE
hr = tblMsgStores.QueryRows(50, 0, out rows);
hr = session.OpenMsgStore(_Handle, lfolderEid, Guid.Empty, 0, out mdb)
//I am getting the folderEid correctly, mdb is IMSGSTORE

but I am not getting anything in the "mdb"  object . Further, I cant
locate any method "QueryInterface" for this MDB object which I think
would initialize mngStore(IExchangeManageStore) to call GetMailboxTable



For your information my reference for this whole issue is
http://support.microsoft.com/?kbid=259570 .............. .though I m
writing my code in C# (the link is in C++) 


Thanks in advance!!
date: 29 May 2006 06:06:32 -0700   author:   tarun

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us