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: Mon, 4 Aug 2008 10:21:00 -0700,    group: microsoft.public.platformsdk.mapi        back       


MAPI Logon   
Hi all!!! I have the following problem.... 

I have a multithread program, each thread creates new MAPI instance (create 
profile, logon, create message e.t.c). Sometimes, when I call Logon(), I get 
RPC_E_SERVERFAULT. (The thread count is 2)
date: Mon, 4 Aug 2008 10:21:00 -0700   author:   Web Service and MAPI

RE: MAPI Logon   
It's not Web Service - it's windows Service
date: Mon, 4 Aug 2008 10:26:43 -0700   author:   Arthur Romanoff

RE: MAPI Logon   
The Logon flags

		hr = MAPILogonEx(NULL,    // Handle to parent window 
			profile_// Profile name 
			NULL,   // Password 
			MAPI_NEW_SESSION | 
			MAPI_NT_SERVICE |
			MAPI_NO_MAIL |
			MAPI_USE_DEFAULT |
			MAPI_EXTENDED, 
			// Logon flags 
			&pSession_);
date: Mon, 4 Aug 2008 10:32:04 -0700   author:   Arthur Romanoff

Re: MAPI Logon   
You do call MAPIInitialie on each thread, right?

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Arthur Romanoff"  wrote in 
message news:F362DD62-19E0-47A2-A28A-12F64B992E4D@microsoft.com...
> The Logon flags
>
> hr = MAPILogonEx(NULL,    // Handle to parent window
> profile_// Profile name
> NULL,   // Password
> MAPI_NEW_SESSION |
> MAPI_NT_SERVICE |
> MAPI_NO_MAIL |
> MAPI_USE_DEFAULT |
> MAPI_EXTENDED,
> // Logon flags
> &pSession_);
>
>
>
date: Mon, 4 Aug 2008 11:38:12 -0700   author:   Dmitry Streblechenko

Re: MAPI Logon   
This is my call:

		MAPIINIT_0 MAPIInit;
		MAPIInit.ulFlags = MAPI_NO_COINIT | MAPI_MULTITHREAD_NOTIFICATIONS | 
MAPI_NT_SERVICE;
		MAPIInit.ulVersion = MAPI_INIT_VERSION;

		MAPIInitialize (&MAPIInit);
date: Mon, 4 Aug 2008 22:53:02 -0700   author:   Arthur Romanoff

Re: MAPI Logon   
Do you also call CoInitialize()?

-- 
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool
-
"Arthur Romanoff"  wrote in 
message news:DECBBC8A-E521-4086-9B43-44162C2769F8@microsoft.com...
> This is my call:
>
> MAPIINIT_0 MAPIInit;
> MAPIInit.ulFlags = MAPI_NO_COINIT | MAPI_MULTITHREAD_NOTIFICATIONS |
> MAPI_NT_SERVICE;
> MAPIInit.ulVersion = MAPI_INIT_VERSION;
>
> MAPIInitialize (&MAPIInit);
>
date: Mon, 4 Aug 2008 23:06:57 -0700   author:   Dmitry Streblechenko

Re: MAPI Logon   
No, it's doing C# when connect to COM object. I'm calling MAPI from C#
date: Tue, 5 Aug 2008 00:18:02 -0700   author:   Arthur Romanoff

Re: MAPI Logon   
This error being when I'm trying to create Profiles(2 or 3 profiles).
CreateProfile throw E_ACCESSDENIED error, but previous profile was create 
successfully with same Server and Mailbox name.
date: Tue, 5 Aug 2008 02:09:01 -0700   author:   Arthur Romanoff

Re: MAPI Logon   
The CreateProfile return MAPI_E_NO_ACCESS 

When I do that it working

hr = MAPI_E_NO_ACCESS;
int TRY_CREATE_PROFILE = 3000;
while(hr == MAPI_E_NO_ACCESS && TRY_CREATE_PROFILE--)
{
	hr = pProfAdmin_->CreateProfile( buf, NULL, 0L, 0L);
	if (hr == MAPI_E_NO_ACCESS)
	{
		mapi_EnsureCrazyProfileDeleted(pProfAdmin_, profile_);
		CTime time = CTime::GetCurrentTime();

		sprintf( buf, "Profile_%d_%d_%d_%d", time.GetYear(),  
                           time.GetMonth(), time.GetDay(), 
time.GetTickCount());
				continue;
	}
}
if ( FAILED(hr) )
{
	throw _com_error(hr);
}
date: Tue, 5 Aug 2008 04:11:01 -0700   author:   Arthur Romanoff

Re: MAPI Logon   
I found the problem...
date: Tue, 5 Aug 2008 09:03:01 -0700   author:   Arthur Romanoff

Google
 
Web ureader.com


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