Thread: MS Exchange Calender access

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    MS Exchange Calender access

    is it possible to connect to a ms exchange server (from a difrent pc) and then view/ modify the calendar of difrent users.

    I downloaded thje exchange sdk and I was able to connect to the exchange server and add an appointment to the callendar of every user.
    But this app has to run on the server and started by the admin user.

    How can I connect to the server with my app from a remote location?

    here's the code I used and that works when I run it on the server:
    Code:
    IMailboxPtr ConnectToMailbox(bstr_t mailTo)
    {
    	try
    	{
            // Create a pointer to the CDOEX Person interface. This will
            // be used to determine the URL of the user's inbox.
            IPersonPtr iPerson(__uuidof(Person));
    
            // Create a pointer to the ADO Connection interface. This
            // will be used as the connection to the mailbox.
            _ConnectionPtr connection(__uuidof(Connection));
    
    		// Set the provider to the Exchange OLEDB driver.
    		connection->Provider = "ExOLEDB.DataSource";
            // Open the user's mailbox.
    		iPerson->DataSource->Open(mailTo,variant_t( (IDispatch*)connection, true),
    adModeRead,adFailIfNotExists,adOpenSource, bstr_t(),bstr_t());
    		cout << "Datasource open" <<endl;
    
    		// Return a pointer to the CDOEX Person interface.
    		return iPerson;
    	}
    	catch(_com_error error)
    	{
            // Display error information. Implement custom error handling here.
    		cout << endl
    			 << "ConnectToMailbox threw the following error:"
    			 << endl
    			 << endl
    			 << "\t"
    			 << error.ErrorMessage()
    			 << endl
    			 << endl
    			 << "Make sure the alias exists. Also check to see if you "
                 << "are running this application on an Exchange server."
    			 << endl;
    
    		throw error;
    	}
    }
    So I figured I need to say where he can find the exchange server.
    I added this line (found on google)
    Code:
    connection->Open("http://server.testexchange.test/exchange",Administrator,"password",-1);
    server is the pc name and "testexchange.test"is the domain
    and I've put that string in my host file.
    when I enter "http://server.testexchange.test/exchange" in my browser, it works fine and I can logon to my mailbox.
    but that doesn't seem to work in my program

    Does anyone here has experience with CDO, or knows where I can find on overview of the api (like: _ConnectionPtr, IAppointmentPtr), what memberfunctions they have and what arguments they take etc. All I can find on msdn are examples that need to run on the server (wich won't be possible I think in my case)

    any help on CDO's calendar functions, connections, etc is welcome. (even if you're not sure it can help me )

    -maes
    Last edited by maes; 07-16-2004 at 07:52 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Speed test result
    By audinue in forum C Programming
    Replies: 4
    Last Post: 07-07-2008, 05:18 AM
  2. Error connecting from Dev C++ to MS Access Database
    By Sridar in forum C++ Programming
    Replies: 0
    Last Post: 04-15-2006, 06:09 PM
  3. Ping
    By ZakkWylde969 in forum Tech Board
    Replies: 5
    Last Post: 09-23-2003, 12:28 PM
  4. The Timing is incorret
    By Drew in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2003, 04:57 PM
  5. using DAO without MS Access installed
    By zMan in forum Windows Programming
    Replies: 2
    Last Post: 02-20-2002, 03:14 PM