?
Solved

Sample Code for MS Exchange in VC++?

Posted on 2003-02-28
12
Medium Priority
?
236 Views
Last Modified: 2010-07-27
Hi Experts,

I am doing some application for MS Exchange, I am newbie for this, I need to know are there any sites for sample codes in vc++?

Please help me.

Thank you,
0
Comment
Question by:Sridharrv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
12 Comments
 

Expert Comment

by:petemullis
ID: 8052731
If you're using VC++ you might want to look at the MAPI examples for writing Exchange clients here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/_mapi1book_finding_what_you_need.asp

If you find this a bit overwhelming, you can always search for examples of CDO and C++:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_using_c_header_files.asp

For grabbing info from directory services (Exchange 5.5 or W2K-AD), you can look at ADSI techniques in C++:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/adsi/setting_up_c___for_adsi_development.asp

Good luck!

Pete
0
 

Author Comment

by:Sridharrv
ID: 8055494
Is there anyway to add a new field to MS Exchnage Mailbox just like TO, CC, BCC, Subject, In App, I need to add a new field,This field maybe hidden from the user, when they open the mail message in outlook client. I will update the field from my app. can you help in this?
0
 

Author Comment

by:Sridharrv
ID: 8056491
Is there anyway to add a new field to MS Exchnage Mailbox just like TO, CC, BCC, Subject, In App, I need to add a new field,This field maybe hidden from the user, when they open the mail message in outlook client. I will update the field from my app. can you help in this?
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 

Author Comment

by:Sridharrv
ID: 8056505
Hi Pete,

Thank you for your kindly help.

I tried the example that is given in URL

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/adsi/setting_up_c___for_adsi_development.asp

but unfortunately, I user was not created as the example states that user should be created in ADS.

I had changed

 hr = ADsGetObject( L"LDAP://CN=users,DC=mydomain,DC=local",   IID_IADsContainer, (void**) &pCont );

but I did not got any error, but user was also not created.

Can u help to find what is the problem in my approach.

Thank you,
0
 

Expert Comment

by:petemullis
ID: 8060545
Sridharry,

If you create your own custom form, based on the mail message form, you can then publish this to an organisational forms folder and set it as default for your clients.

Design a form in outlook by going "Tools / Forms / Design a Form" then choose "Message"
Make a form any way you like and publish it.

Check out this web page to set a new default form:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q295064&ID=KB;EN-US;q295064

I'm going to have a look at how you can use C++ and mapi to work with the form you created.

Pete
0
 

Author Comment

by:Sridharrv
ID: 8062149
Hi Pete,

Thanx alot for your kind help, I will be definetly need all the information which you have passed.

Let me just brief you what I am doing, I am going to read the messages from the users mailbox(inbox)& read the contents of it, for further processing. when I read the messages of any mailbox, I need to mark that as processed in some field. This all should happen from my app which will be a daemon app.

Now if I add a field IPM.Note.default (my custom form), will that be updated even in my exchange server mailbox template? Can I be able to read the new field(s) which I have added in IPM.NOTE.DEFAULT from my app.

Thank once again.
0
 

Author Comment

by:Sridharrv
ID: 8065834
Hi Pete,

I am using

"pDropDir->GetMessages(L"file://./backofficestorage/mydomain/mbx/myuser/inbox/",&pMsgs);
to get the messages from the users inbox.

I am able to get messages & read through them. Now what I want to know is since I am testing my code on the exchange server I think it is working fine. Is there any change to be done if I am running my code on other machine.

I will logon to the same domain(mydomain) or maybe other domain (otherdomain).

Please help me.

Thanx a ton for your kind help.

0
 

Accepted Solution

by:
petemullis earned 150 total points
ID: 8068587
I believe pDropDir is a CDO technique.

If you are running your code from another machine you will need to ensure the name of the Exchange server is in your "file://" path.

If you are running from the same domain as the Exchange server you should have no problems, but if you are running from another domain you may need to consider "impersonation" code to change the ID of the current thread to an ID that exists in the domain containing Exchange.
0
 

Author Comment

by:Sridharrv
ID: 8070573
Hi Pete,

I tried changing mydomain to myserver name & tried working from other machine which was in the same domain (mydomain) but I could not connect, it was giving the error.

pDropDir->GetMessages(L"file://./backofficestorage/mydomain/mbx/myuser/inbox/",&pMsgs);

in the above staement I even changed to myserver name at for each parameter, but no use, I went through some of the book but  I could not find how can I work from other machine instead of my exchange server. on Excange server code is perfectly working.

I don't want to use MAPI function, since it becomes more complicated. Now for my app to work fine, I need to know how to work from other machine in the same domain.

Please help me.

Thanx aton.
0
 

Expert Comment

by:petemullis
ID: 8074959
Does the user account you use from the other machine have NTFS rights to access the backoffice storage on Exchange?

Pete
0
 

Author Comment

by:Sridharrv
ID: 8077175
Yes, I am using Administrator, who have all the rights.

Thanx
0
 

Author Comment

by:Sridharrv
ID: 8078373
Pete,

can I use
"CN=Mailbox Store,CN=First Storage Group,CN=InformationStore,CN=Servername,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=ORGNAME,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domainname,DC=com"

which is my mailbox store for the user, as LDAP URL.

Instead of using "file://...." can we user "LDAP://......"

if you so ,can you adivse me how to do it.

Thank you
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
how to add IIS SMTP to handle application/Scanner relays into office 365.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses
Course of the Month7 days, 23 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question