Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Sat, 26 Jan 2008 18:43:09 +0530,    group: microsoft.public.platformsdk.mapi        back       


List email accounts in a profile   
Hi,
Is it possible to list the email accounts in outlook profile using MAPI ?
What are the APIs? I can access all other things using MAPI and know how to
use them but I am unable to locate the APIs/Interface through which I can
list the email accounts configured in a profile.

I also posted this query at
http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html
but no one replied :(

Regards,
Ashutosh
date: Sat, 26 Jan 2008 18:43:09 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
Use teh profile management API (IProfAdmin) and IOlkAccountManager (for 
non-MAPI accounts).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

"Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
news:eg6p10BYIHA.5816@TK2MSFTNGP06.phx.gbl...
> Hi,
> Is it possible to list the email accounts in outlook profile using MAPI ?
> What are the APIs? I can access all other things using MAPI and know how 
> to
> use them but I am unable to locate the APIs/Interface through which I can
> list the email accounts configured in a profile.
>
> I also posted this query at
> http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html
> but no one replied :(
>
> Regards,
> Ashutosh
>
>
>
date: Mon, 28 Jan 2008 00:15:33 -0700   author:   Dmitry Streblechenko

Re: List email accounts in a profile   
Hi Dmitry,
Thanks for your reply...now I have some hope.
I tried finding IOlkAccountManager in MSDN, but when I couldn't find it, 
   tried searching it on the net, and I found it on online MSDN and also 
lots posts by you on forums.

You mentioned that there doesn't exist a header for this interface. I 
tried defining this interface manually but to define it I need to define 
some more interface and I think the chain will continue.

Isn't there an easy way???

Regards,
Ashutosh


Dmitry Streblechenko wrote:
> Use teh profile management API (IProfAdmin) and IOlkAccountManager (for 
> non-MAPI accounts).
> 
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
> 
> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
> news:eg6p10BYIHA.5816@TK2MSFTNGP06.phx.gbl...
>> Hi,
>> Is it possible to list the email accounts in outlook profile using MAPI ?
>> What are the APIs? I can access all other things using MAPI and know how 
>> to
>> use them but I am unable to locate the APIs/Interface through which I can
>> list the email accounts configured in a profile.
>>
>> I also posted this query at
>> http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html
>> but no one replied :(
>>
>> Regards,
>> Ashutosh
>>
>>
>>
> 
>
date: Mon, 28 Jan 2008 23:03:55 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
This *is* an easy way :-)
I do not use C++, so I can't help you with the headers, sorry.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

"Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
news:%23RD22PdYIHA.4160@TK2MSFTNGP03.phx.gbl...
> Hi Dmitry,
> Thanks for your reply...now I have some hope.
> I tried finding IOlkAccountManager in MSDN, but when I couldn't find it, 
> tried searching it on the net, and I found it on online MSDN and also lots 
> posts by you on forums.
>
> You mentioned that there doesn't exist a header for this interface. I 
> tried defining this interface manually but to define it I need to define 
> some more interface and I think the chain will continue.
>
> Isn't there an easy way???
>
> Regards,
> Ashutosh
>
>
> Dmitry Streblechenko wrote:
>> Use teh profile management API (IProfAdmin) and IOlkAccountManager (for 
>> non-MAPI accounts).
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy  - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
>> news:eg6p10BYIHA.5816@TK2MSFTNGP06.phx.gbl...
>>> Hi,
>>> Is it possible to list the email accounts in outlook profile using MAPI 
>>> ?
>>> What are the APIs? I can access all other things using MAPI and know how 
>>> to
>>> use them but I am unable to locate the APIs/Interface through which I 
>>> can
>>> list the email accounts configured in a profile.
>>>
>>> I also posted this query at
>>> http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html
>>> but no one replied :(
>>>
>>> Regards,
>>> Ashutosh
>>>
>>>
>>>
>>
date: Mon, 28 Jan 2008 11:01:43 -0700   author:   Dmitry Streblechenko

Re: List email accounts in a profile   
Hi Dmitry,

I have created all the headers and implemented the required classes. The 
problem is that I can't create object of IOlkAccountManager.

MSDN says
------------------------------------------------------------------
Microsoft Office Outlook 2003 Integration API Reference
IOlkAccountManager [Outlook 2003 API Reference]

Manages access to accounts and sets up notifications about account changes.
Quick Info
Inherits from:	IOlkErrorUnknown
Implemented by:	Outlook
Provided by:	CLSID_OlkAccountManager
Called by:	Client
Interface identifier:	IID_IOlkAccountManager
------------------------------------------------------------------

So, when creating the COM object, I pass in CLSID_OlkAccountManager & 
IID_IOlkAccountManager, which is not defined/registered. I can define 
them myself, but that way MAPI subsystem won't recognize it. So, how do 
I create the objects??

Regards,
Ashutosh

==================================================================
Dmitry Streblechenko wrote:
> This *is* an easy way :-)
> I do not use C++, so I can't help you with the headers, sorry.
> 
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy  - Outlook, CDO
> and MAPI Developer Tool
> 
> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
> news:%23RD22PdYIHA.4160@TK2MSFTNGP03.phx.gbl...
>> Hi Dmitry,
>> Thanks for your reply...now I have some hope.
>> I tried finding IOlkAccountManager in MSDN, but when I couldn't find it, 
>> tried searching it on the net, and I found it on online MSDN and also lots 
>> posts by you on forums.
>>
>> You mentioned that there doesn't exist a header for this interface. I 
>> tried defining this interface manually but to define it I need to define 
>> some more interface and I think the chain will continue.
>>
>> Isn't there an easy way???
>>
>> Regards,
>> Ashutosh
>>
>>
>> Dmitry Streblechenko wrote:
>>> Use teh profile management API (IProfAdmin) and IOlkAccountManager (for 
>>> non-MAPI accounts).
>>>
>>> Dmitry Streblechenko (MVP)
>>> http://www.dimastr.com/
>>> OutlookSpy  - Outlook, CDO
>>> and MAPI Developer Tool
>>>
>>> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
>>> news:eg6p10BYIHA.5816@TK2MSFTNGP06.phx.gbl...
>>>> Hi,
>>>> Is it possible to list the email accounts in outlook profile using MAPI 
>>>> ?
>>>> What are the APIs? I can access all other things using MAPI and know how 
>>>> to
>>>> use them but I am unable to locate the APIs/Interface through which I 
>>>> can
>>>> list the email accounts configured in a profile.
>>>>
>>>> I also posted this query at
>>>> http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html
>>>> but no one replied :(
>>>>
>>>> Regards,
>>>> Ashutosh
>>>>
>>>>
>>>>
>
date: Fri, 28 Mar 2008 01:14:05 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
Hi,
Please ignore my last post. I got the GUIDs for all the interfaces and 
classes.
Thanks & Regards,
Ashutosh

Ashutosh wrote:
> Hi Dmitry,
> 
> I have created all the headers and implemented the required classes. The 
> problem is that I can't create object of IOlkAccountManager.
> 
> MSDN says
> ------------------------------------------------------------------
> Microsoft Office Outlook 2003 Integration API Reference
> IOlkAccountManager [Outlook 2003 API Reference]
> 
> Manages access to accounts and sets up notifications about account changes.
> Quick Info
> Inherits from:    IOlkErrorUnknown
> Implemented by:    Outlook
> Provided by:    CLSID_OlkAccountManager
> Called by:    Client
> Interface identifier:    IID_IOlkAccountManager
> ------------------------------------------------------------------
> 
> So, when creating the COM object, I pass in CLSID_OlkAccountManager & 
> IID_IOlkAccountManager, which is not defined/registered. I can define 
> them myself, but that way MAPI subsystem won't recognize it. So, how do 
> I create the objects??
> 
> Regards,
> Ashutosh
> 
> ==================================================================
> Dmitry Streblechenko wrote:
>> This *is* an easy way :-)
>> I do not use C++, so I can't help you with the headers, sorry.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy  - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
>> news:%23RD22PdYIHA.4160@TK2MSFTNGP03.phx.gbl...
>>> Hi Dmitry,
>>> Thanks for your reply...now I have some hope.
>>> I tried finding IOlkAccountManager in MSDN, but when I couldn't find 
>>> it, tried searching it on the net, and I found it on online MSDN and 
>>> also lots posts by you on forums.
>>>
>>> You mentioned that there doesn't exist a header for this interface. I 
>>> tried defining this interface manually but to define it I need to 
>>> define some more interface and I think the chain will continue.
>>>
>>> Isn't there an easy way???
>>>
>>> Regards,
>>> Ashutosh
>>>
>>>
>>> Dmitry Streblechenko wrote:
>>>> Use teh profile management API (IProfAdmin) and IOlkAccountManager 
>>>> (for non-MAPI accounts).
>>>>
>>>> Dmitry Streblechenko (MVP)
>>>> http://www.dimastr.com/
>>>> OutlookSpy  - Outlook, CDO
>>>> and MAPI Developer Tool
>>>>
>>>> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
>>>> news:eg6p10BYIHA.5816@TK2MSFTNGP06.phx.gbl...
>>>>> Hi,
>>>>> Is it possible to list the email accounts in outlook profile using 
>>>>> MAPI ?
>>>>> What are the APIs? I can access all other things using MAPI and 
>>>>> know how to
>>>>> use them but I am unable to locate the APIs/Interface through which 
>>>>> I can
>>>>> list the email accounts configured in a profile.
>>>>>
>>>>> I also posted this query at
>>>>> http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html 
>>>>>
>>>>> but no one replied :(
>>>>>
>>>>> Regards,
>>>>> Ashutosh
>>>>>
>>>>>
>>>>>
>>
date: Fri, 28 Mar 2008 01:42:28 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
#include "AccountManagerGUIDs.h"
//MIDL_INTERFACE("9240a6c0-af41-11d2-8C3B-00104B2A6676") 
interface IOlkErrorUnknown: public IUnknown
{
	HRESULT GetLastError( HRESULT hr, LPWSTR *ppwszError);
};

//MIDL_INTERFACE("9240a6cb-af41-11d2-8C3B-00104B2A6676")

interface IOlkAccountHelper: public IUnknown
{
	HRESULT Placeholder1 (void*);
	HRESULT GetIdentity ( LPWSTR pwszIdentity,DWORD *pcch);
	HRESULT GetMapiSession(LPUNKNOWN *ppmsess);	
	HRESULT HandsOffSession( );
};
//MIDL_INTERFACE("9240a6c0-af41-11d2-8C3B-00104B2A6676")
interface IOlkEnum : IUnknown
{
	HRESULT GetCount (DWORD *pulCount);
	HRESULT Reset ();
	HRESULT GetNext(LPUNKNOWN *ppunk);
	HRESULT Skip( DWORD cSkip);
};


//MIDL_INTERFACE("9240a6c3-af41-11d2-8C3B-00104B2A6676")
interface IOlkAccountNotify : IUnknown
{
	HRESULT Notify( DWORD dwNotify,	DWORD dwAcctID,	DWORD dwFlags);
};

typedef struct 
{
	DWORD	cb;
	BYTE * pb;
} ACCT_BIN;
typedef struct
{
        DWORD dwType;
        union 
            {
            DWORD dw;
            WCHAR *pwsz;
            ACCT_BIN bin;
            } Val;
} ACCT_VARIANT;

//MIDL_INTERFACE("9240a6d2-af41-11d2-8C3B-00104B2A6676")
interface IOlkAccount : IOlkErrorUnknown
{
	void IOlkAccount_Placeholder1();
	void IOlkAccount_Placeholder2();
	void IOlkAccount_Placeholder3();
	void IOlkAccount_Placeholder4();
	void IOlkAccount_Placeholder5();
	void IOlkAccount_Placeholder6();

	HRESULT GetAccountInfo( CLSID *pclsidType,DWORD *pcCategories,CLSID **prgclsidCategory);
	HRESULT GetProp( DWORD dwProp,ACCT_VARIANT *pVar);
	HRESULT SetProp( DWORD dwProp,ACCT_VARIANT *pVar);
	
	void IOlkAccount_Placeholder7();
	void IOlkAccount_Placeholder8();
	void IOlkAccount_Placeholder9();
	
	HRESULT FreeMemory ( BYTE *pv);
	
	void IOlkAccount_Placeholder10();
	
	HRESULT SaveChanges ( DWORD dwFlags);
};

		
//MIDL_INTERFACE("9240a6cd-af41-11D2-8C3B-00104B2A6676")
interface IOlkAccountManager : IOlkErrorUnknown
{
	HRESULT Init (IOlkAccountHelper *pAcctHelper, DWORD dwFlags);

	void IOlkAccountManager_Placeholder1();
	void IOlkAccountManager_Placeholder2();
	void IOlkAccountManager_Placeholder3();
	void IOlkAccountManager_Placeholder4();
	void IOlkAccountManager_Placeholder5();
	void IOlkAccountManager_Placeholder6();

	HRESULT FindAccount ( DWORD dwProp,	ACCT_VARIANT *pVar,	IOlkAccount **ppAccount);

	void IOlkAccountManager_Placeholder7();
	void IOlkAccountManager_Placeholder8();
	void IOlkAccountManager_Placeholder9();

	HRESULT DeleteAccount ( DWORD dwAcctID);

	void IOlkAccountManager_Placeholder10();

	HRESULT SaveChanges (DWORD dwAcctID, DWORD dwFlags );
	HRESULT GetOrder (const CLSID *pclsidCategory, DWORD *pcAccts, DWORD *prgAccts[]);
	HRESULT SetOrder (const CLSID *pclsidCategory, DWORD *pcAccts, DWORD *prgAccts[]);
	HRESULT EnumerateAccounts (const CLSID *pclsidCategory, const CLSID *pclsidType, DWORD dwFlags, IOlkEnum **ppEnum);
	
	void IOlkAccountManager_Placeholder11();
	void IOlkAccountManager_Placeholder12();
	
	HRESULT FreeMemory (BYTE *pv);
	HRESULT Advise ( IOlkAccountNotify *pNotify, DWORD *pdwCookie);
	HRESULT Unadvise ( DWORD *pdwCookie);

	void IOlkAccountManager_Placeholder13();
	void IOlkAccountManager_Placeholder14();
	void IOlkAccountManager_Placeholder15();
};
date: Tue, 08 Apr 2008 23:46:41 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
I do not use C++, but it looks perfectly fine to me.

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
news:%23rseySamIHA.1680@TK2MSFTNGP06.phx.gbl...
> Hi Dmitry,
> I have created all the header files and defined the GUIDS, but when I
> include the code for creating an instance (CoCreateInstance) I get
> linker error.
>
> The code is:
> IOlkAccountManager * ppv;
> CoCreateInstance(CLSID_OlkAccountManager,NULL, 0,
> IID_IOlkAccountManager, (void**)&ppv);
>
>
> and the error I get is
>
> MAPI1Dlg.obj : error LNK2001: unresolved external symbol
> _CLSID_OlkAccountManager
> MAPI1Dlg.obj : error LNK2001: unresolved external symbol
> _IID_IOlkAccountManager
>
> The header files are attached, please have a look if you can.
>
> I think I need to include some library in the project. Currently I have
> these libraries included
>
> mapi32.lib, Edkguid.lib, Edkutils.lib, Edkmapi.lib, Addrlkup.lib,
> Edkdebug.lib, Version.lib, Mblogon.lib
>
> Please help!!!
>
> Regards,
> Ashutosh
>
> Dmitry Streblechenko wrote:
>> Use teh profile management API (IProfAdmin) and IOlkAccountManager (for
>> non-MAPI accounts).
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy  - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "Ashutosh" <smbs_user@newsgroup.nospam> wrote in message
>> news:eg6p10BYIHA.5816@TK2MSFTNGP06.phx.gbl...
>>> Hi,
>>> Is it possible to list the email accounts in outlook profile using MAPI 
>>> ?
>>> What are the APIs? I can access all other things using MAPI and know how
>>> to
>>> use them but I am unable to locate the APIs/Interface through which I 
>>> can
>>> list the email accounts configured in a profile.
>>>
>>> I also posted this query at
>>> http://www.experts-exchange.com/Microsoft/Development/Microsoft_Programming/Q_23086947.html
>>> but no one replied :(
>>>
>>> Regards,
>>> Ashutosh
>>>
>>>
>>>
>>
>>
>
>


--------------------------------------------------------------------------------


> //#include <guiddef.h>
> //Use the DEFINE_GUID macro defined in the Platform SDK header file 
> guiddef.h to associate the GUID symbolic name with its value.
>
> //{ed475410-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkAccountManager, 0xed475410, 0xb0d6, 0x11d2, 0x8c, 
> 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{ed475411-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkPOP3Account, 0xed475411, 0xb0d6, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{ed475412-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkIMAP4Account, 0xed475412, 0xb0d6, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{ed475414-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkMAPIAccount, 0xed475414, 0xb0d6, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{ed475418-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkMail, 0xed475418, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 
> 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{ed475419-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkAddressBook, 0xed475419, 0xb0d6, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{ed475420-b0d6-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(CLSID_OlkStore, 0xed475420, 0xb0d6, 0x11d2, 0x8c, 0x3b, 0x0, 
> 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{4db5cbf0-3b77-4852-bc8e-bb81908861f3}
>
> DEFINE_GUID(CLSID_OlkHotmailAccount, 0x4db5cbf0, 0x3b77, 0x4852, 0xbc, 
> 0x8e, 0xbb, 0x81, 0x90, 0x88, 0x61, 0xf3);
>
> //{4db5cbf2-3b77-4852-bc8e-bb81908861f3}
>
> DEFINE_GUID(CLSID_OlkLDAPAccount, 0x4db5cbf2, 0x3b77, 0x4852, 0xbc, 0x8e, 
> 0xbb, 0x81, 0x90, 0x88, 0x61, 0xf3);
>
> ///////////////////////////////////////////////////////////////////////
> //Interface Identifiers
> //----------------------
>
> //Use the DEFINE_GUID macro defined in the Platform SDK header file 
> guiddef.h to associate the GUID symbolic name with its value.
>
> //{9240A6C0-AF41-11d2-8C3B-00104B2A6676}
>
> DEFINE_GUID(IID_IOlkErrorUnknown, 0x9240a6c0, 0xaf41, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{9240A6C1-AF41-11d2-8C3B-00104B2A6676 }
>
> DEFINE_GUID(IID_IOlkEnum, 0x9240a6c0, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 
> 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{9240a6c3-af41-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(IID_IOlkAccountNotify, 0x9240a6c3, 0xaf41, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{9240a6cb-af41-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(IID_IOlkAccountHelper, 0x9240a6cb, 0xaf41, 0x11d2, 0x8c, 0x3b, 
> 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{9240a6cd-af41-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(IID_IOlkAccountManager, 0x9240a6cd, 0xaf41, 0x11d2, 0x8c, 
> 0x3b, 0x0, 0x10, 0x4b, 0x2a, 0x66, 0x76);
>
> //{9240a6d2-af41-11d2-8c3b-00104b2a6676}
>
> DEFINE_GUID(IID_IOlkAccount, 0x9240a6d2, 0xaf41, 0x11d2, 0x8c, 0x3b, 0x0, 
> 0x10, 0x4b, 0x2a, 0x66, 0x76);


--------------------------------------------------------------------------------


> #include "AccountManagerGUIDs.h"
> //MIDL_INTERFACE("9240a6c0-af41-11d2-8C3B-00104B2A6676")
> interface IOlkErrorUnknown: public IUnknown
> {
> HRESULT GetLastError( HRESULT hr, LPWSTR *ppwszError);
> };
>
> //MIDL_INTERFACE("9240a6cb-af41-11d2-8C3B-00104B2A6676")
>
> interface IOlkAccountHelper: public IUnknown
> {
> HRESULT Placeholder1 (void*);
> HRESULT GetIdentity ( LPWSTR pwszIdentity,DWORD *pcch);
> HRESULT GetMapiSession(LPUNKNOWN *ppmsess);
> HRESULT HandsOffSession( );
> };
> //MIDL_INTERFACE("9240a6c0-af41-11d2-8C3B-00104B2A6676")
> interface IOlkEnum : IUnknown
> {
> HRESULT GetCount (DWORD *pulCount);
> HRESULT Reset ();
> HRESULT GetNext(LPUNKNOWN *ppunk);
> HRESULT Skip( DWORD cSkip);
> };
>
>
> //MIDL_INTERFACE("9240a6c3-af41-11d2-8C3B-00104B2A6676")
> interface IOlkAccountNotify : IUnknown
> {
> HRESULT Notify( DWORD dwNotify, DWORD dwAcctID, DWORD dwFlags);
> };
>
> typedef struct
> {
> DWORD cb;
> BYTE * pb;
> } ACCT_BIN;
> typedef struct
> {
>        DWORD dwType;
>        union
>            {
>            DWORD dw;
>            WCHAR *pwsz;
>            ACCT_BIN bin;
>            } Val;
> } ACCT_VARIANT;
>
> //MIDL_INTERFACE("9240a6d2-af41-11d2-8C3B-00104B2A6676")
> interface IOlkAccount : IOlkErrorUnknown
> {
> void IOlkAccount_Placeholder1();
> void IOlkAccount_Placeholder2();
> void IOlkAccount_Placeholder3();
> void IOlkAccount_Placeholder4();
> void IOlkAccount_Placeholder5();
> void IOlkAccount_Placeholder6();
>
> HRESULT GetAccountInfo( CLSID *pclsidType,DWORD *pcCategories,CLSID 
> **prgclsidCategory);
> HRESULT GetProp( DWORD dwProp,ACCT_VARIANT *pVar);
> HRESULT SetProp( DWORD dwProp,ACCT_VARIANT *pVar);
>
> void IOlkAccount_Placeholder7();
> void IOlkAccount_Placeholder8();
> void IOlkAccount_Placeholder9();
>
> HRESULT FreeMemory ( BYTE *pv);
>
> void IOlkAccount_Placeholder10();
>
> HRESULT SaveChanges ( DWORD dwFlags);
> };
>
>
> //MIDL_INTERFACE("9240a6cd-af41-11D2-8C3B-00104B2A6676")
> interface IOlkAccountManager : IOlkErrorUnknown
> {
> HRESULT Init (IOlkAccountHelper *pAcctHelper, DWORD dwFlags);
>
> void IOlkAccountManager_Placeholder1();
> void IOlkAccountManager_Placeholder2();
> void IOlkAccountManager_Placeholder3();
> void IOlkAccountManager_Placeholder4();
> void IOlkAccountManager_Placeholder5();
> void IOlkAccountManager_Placeholder6();
>
> HRESULT FindAccount ( DWORD dwProp, ACCT_VARIANT *pVar, IOlkAccount 
> **ppAccount);
>
> void IOlkAccountManager_Placeholder7();
> void IOlkAccountManager_Placeholder8();
> void IOlkAccountManager_Placeholder9();
>
> HRESULT DeleteAccount ( DWORD dwAcctID);
>
> void IOlkAccountManager_Placeholder10();
>
> HRESULT SaveChanges (DWORD dwAcctID, DWORD dwFlags );
> HRESULT GetOrder (const CLSID *pclsidCategory, DWORD *pcAccts, DWORD 
> *prgAccts[]);
> HRESULT SetOrder (const CLSID *pclsidCategory, DWORD *pcAccts, DWORD 
> *prgAccts[]);
> HRESULT EnumerateAccounts (const CLSID *pclsidCategory, const CLSID 
> *pclsidType, DWORD dwFlags, IOlkEnum **ppEnum);
>
> void IOlkAccountManager_Placeholder11();
> void IOlkAccountManager_Placeholder12();
>
> HRESULT FreeMemory (BYTE *pv);
> HRESULT Advise ( IOlkAccountNotify *pNotify, DWORD *pdwCookie);
> HRESULT Unadvise ( DWORD *pdwCookie);
>
> void IOlkAccountManager_Placeholder13();
> void IOlkAccountManager_Placeholder14();
> void IOlkAccountManager_Placeholder15();
> };
>
date: Wed, 9 Apr 2008 17:15:06 -0700   author:   Dmitry Streblechenko

Re: List email accounts in a profile   
Dmitry Streblechenko wrote:
> I do not use C++, but it looks perfectly fine to me.
> 
Hi,
Whatever language you might be using, you must have included some 
libraries(provided by Microsoft) in your project. I think thats all I 
want to know for running that code.

Regards,
Ashutosh
date: Thu, 10 Apr 2008 05:38:41 -0400   author:   Ashutosh am

Re: List email accounts in a profile   
Hi Ashutosh,

>> I do not use C++, but it looks perfectly fine to me.
>
> Whatever language you might be using, you must have included some
> libraries(provided by Microsoft) in your project. I think thats all I
> want to know for running that code.

No, your usage of DEFINE_GUID is not correct. You got an answer
with a KB article from microsoft in another group. Please follow these
steps to use the INITGUID define.

Typically you create a pair of guids.cpp and guids.h
Put your DEFINE_GUID macros in guids.h

Your guids.cpp looks like this. Place INITGUID at the beginning,
this is important!

#define INITGUID
#include <objbase.h>
#include <initguid.h>
#include "guids.h"

Be sure to disable precompiled headers for guids.cpp

Include guids.h where you need your guids in code.

--
SvenC
date: Thu, 10 Apr 2008 15:01:07 +0200   author:   SvenC am

Re: List email accounts in a profile   
Something most people don't realise: You don't need to define INITGUID *and* 
include initguid.h. Here's what's in initguid.h:
#define INITGUID
#include <guiddef.h>

So defining INITGUID yourself is actually redundant. :)

"SvenC" <SvenC@nospam.nospam> wrote in message 
news:F45E7CE6-C4B7-4F1A-A521-7473027B24FB@microsoft.com...
> Hi Ashutosh,
>
>>> I do not use C++, but it looks perfectly fine to me.
>>
>> Whatever language you might be using, you must have included some
>> libraries(provided by Microsoft) in your project. I think thats all I
>> want to know for running that code.
>
> No, your usage of DEFINE_GUID is not correct. You got an answer
> with a KB article from microsoft in another group. Please follow these
> steps to use the INITGUID define.
>
> Typically you create a pair of guids.cpp and guids.h
> Put your DEFINE_GUID macros in guids.h
>
> Your guids.cpp looks like this. Place INITGUID at the beginning,
> this is important!
>
> #define INITGUID
> #include <objbase.h>
> #include <initguid.h>
> #include "guids.h"
>
> Be sure to disable precompiled headers for guids.cpp
>
> Include guids.h where you need your guids in code.
>
> --
> SvenC
date: Thu, 10 Apr 2008 10:20:38 -0400   author:   Stephen Griffin [MSFT]

Re: List email accounts in a profile   
Hi Stephen,

> Something most people don't realise: You don't need to define
> INITGUID *and* include initguid.h. Here's what's in initguid.h:
> #define INITGUID
> #include <guiddef.h>
> 
> So defining INITGUID yourself is actually redundant. :)

Uupsi - just took it from a book sample and never cared to
look inside the header ;-)

Thanks for clarification.

--
SvenC
date: Thu, 10 Apr 2008 17:48:17 +0200   author:   SvenC am

Re: List email accounts in a profile   
No, I have not - I just looked at the docs and typed by own interface 
definitions and their GUIDs in Delphi.

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Ashutosh" <smbs_user@newsgroup.nospam> wrote in message 
news:OO8Tq6umIHA.5944@TK2MSFTNGP03.phx.gbl...
> Dmitry Streblechenko wrote:
>> I do not use C++, but it looks perfectly fine to me.
>>
> Hi,
> Whatever language you might be using, you must have included some 
> libraries(provided by Microsoft) in your project. I think thats all I want 
> to know for running that code.
>
> Regards,
> Ashutosh
date: Thu, 10 Apr 2008 11:41:45 -0700   author:   Dmitry Streblechenko

Re: List email accounts in a profile   
Hi,
The linker issue I mentioned is now solved, but the CoCreateInstance 
always fails, don't know why???

	IOlkAccountManager * ppv = NULL;
	HRESULT hr= CoCreateInstance(CLSID_OlkAccountManager,NULL, 0, 
IID_IOlkAccountManager, (void**)&ppv);

Object creation has nothing to do with the interface definition. It just 
need the class ID and Interface IDs. It's required only if the object is 
used and as far as GUIDs are concerned, I don't think there is any 
problem with them. So, whys isn't the object getting created? Can you 
please check?

Regards,
Ashutosh

Dmitry Streblechenko wrote:
> No, I have not - I just looked at the docs and typed by own interface 
> definitions and their GUIDs in Delphi.
>
date: Mon, 14 Apr 2008 23:01:50 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
Hi Ashutosh,

> Hi,
> The linker issue I mentioned is now solved, but the CoCreateInstance
> always fails, don't know why???
> 
> IOlkAccountManager * ppv = NULL;
> HRESULT hr= CoCreateInstance(CLSID_OlkAccountManager,NULL, 0,
> IID_IOlkAccountManager, (void**)&ppv);

What value has hr?

Did you call CoInitialize before using CoCreateInstance?

--
SvenC
date: Mon, 14 Apr 2008 21:32:47 +0200   author:   SvenC am

Re: List email accounts in a profile   
The error code is Class not registered (80040154)
Regards,
Ashutosh

SvenC wrote:
> Hi Ashutosh,
> 
>> Hi,
>> The linker issue I mentioned is now solved, but the CoCreateInstance
>> always fails, don't know why???
>>
>> IOlkAccountManager * ppv = NULL;
>> HRESULT hr= CoCreateInstance(CLSID_OlkAccountManager,NULL, 0,
>> IID_IOlkAccountManager, (void**)&ppv);
> 
> What value has hr?
> 
> Did you call CoInitialize before using CoCreateInstance?
> 
> -- 
> SvenC
>
date: Tue, 15 Apr 2008 07:46:07 +0530   author:   Ashutosh am

Re: List email accounts in a profile   
Hi Ashutosh,

> The error code is Class not registered (80040154)

Is Outlook 2003 or higher installed? If yes, double check
if you got the classid define correct.

--
SvenC
date: Tue, 15 Apr 2008 08:55:21 +0200   author:   SvenC am

Re: List email accounts in a profile   
Hi All,
Thank you all for your help.
The issue has been resolved.

Regards,
Ashutosh

SvenC wrote:
> Hi Ashutosh,
> 
>> The error code is Class not registered (80040154)
> 
> Is Outlook 2003 or higher installed? If yes, double check
> if you got the classid define correct.
> 
> -- 
> SvenC
date: Fri, 18 Apr 2008 12:51:38 +0530   author:   Ashutosh am

Google
 
Web ureader.com


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