• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

Sample Code for MS Exchange in VC++?

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
Sridharrv
Asked:
Sridharrv
  • 8
  • 4
1 Solution
 
petemullisCommented:
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
 
SridharrvAuthor Commented:
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
 
SridharrvAuthor Commented:
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
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

 
SridharrvAuthor Commented:
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
 
petemullisCommented:
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
 
SridharrvAuthor Commented:
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
 
SridharrvAuthor Commented:
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
 
petemullisCommented:
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
 
SridharrvAuthor Commented:
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
 
petemullisCommented:
Does the user account you use from the other machine have NTFS rights to access the backoffice storage on Exchange?

Pete
0
 
SridharrvAuthor Commented:
Yes, I am using Administrator, who have all the rights.

Thanx
0
 
SridharrvAuthor Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 8
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now