Board index » delphi » MAPILogonEx in MS Exchange!

MAPILogonEx in MS Exchange!


2003-09-27 09:20:14 PM
delphi188
Hi people,
How can logon my inbox without profile in MS Outlook, or either, direct in
then Exchange?
thx
--
PAZ!!
-=|ߡ?|=-
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
 
 

Re:MAPILogonEx in MS Exchange!

You need to create a temporary profile, populate its data with the name of
the server and mailbox, then use the name of the profile to call
MAPILogonEx(). See Q170225 on MSDN.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Bit" <XXXX@XXXXX.COM>writes
Quote
Hi people,
How can logon my inbox without profile in MS Outlook, or either, direct in
then Exchange?

thx


--
PAZ!!
-=|ߡ?|=-


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003


 

Re:MAPILogonEx in MS Exchange!

thank you Dmitry!
The code below I not obtain to configure profile, wich the problem?
function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
hCurrentBranch:TTreeNode;
pProfAdmin:IPROFADMIN;
pszProfileName:PCHAR;
psNomeServidor,psUsuario:String):HRESULT;
var
hr : HRESULT;
pServices :IMsgServiceAdmin;
pMTServices:IMAPITABLE;
pProviderAdmin:IPROVIDERADMIN;
hService:TTreeNode;
ulRowCount,
ulCount:ULONG;
lpRows :PSRowSet; // Table
lpRow :PSRow; // 1 row from table
lpProp :PSPropValueArray; // 1 Prop (column) from row
Columns:PSPropTagArray;
pInfo : TCItemInfo;
ppProfile:IOpenSectionHack;
label ret;
begin
pServices:=nil;
pMTServices:=nil;
pProviderAdmin:=nil;
ulRowCount:=0;
lpRows :=nil;
lpRow :=nil;
Columns:=nil;
hCurrentBranch.Selected:=True;
hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
s));
if (FAILED(hr)) then
begin
EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
goto ret;
end;
Columns.cValues:=3;
Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
// Get a service admin interface
hr := pProfAdmin.AdminServices(pszProfileName, // profile name
nil, // no profile password
ULONG(GetActiveWindow()), // parent wnd
0, // Allow UI
pServices); // message service
administration object pointer
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('AdminServices Failed!');
goto ret;
end;
// Get a table of services in the provider.
hr := pServices.GetMsgServiceTable(0, pMTServices);
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
goto ret;
end;
hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('SetColumns Failed!');
goto ret;
end;
hr := pMTServices.GetRowCount(0, ulRowCount);
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('GetRowCount Failed!');
goto ret;
end;
// Get all of the rows.
hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
if (FAILED(hr)) then
begin
EMAPILogger.LogMessage('QueryRows Failed!');
goto ret;
end;
MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
Prop));
// Loop through all Services and get the providers for each
lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
lpProp[0].Value.lpszA := PChar(psNomeServidor);
lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
lpProp[1].Value.lpszA := PChar(psUsuario);
//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
hr:=
pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
,LPSPropValue(lpProp));
if FAILED(hr) then
begin
EMAPILogger.LogMessage('Configuracao do servidor Failed!');
goto ret;
end;
ret:
if Assigned(lpRows) then FreeProws(lpRows);
if Assigned(pMTServices) then pMTServices:=nil;
if Assigned(pServices) then pServices:=nil; // Released in CItemInfo
if Assigned(Columns) then
MapiFreeBuffer(Columns);
Result:=hr;
end;
"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
Quote
You need to create a temporary profile, populate its data with the name of
the server and mailbox, then use the name of the profile to call
MAPILogonEx(). See Q170225 on MSDN.

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


"Bit" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Hi people,
>How can logon my inbox without profile in MS Outlook, or either, direct
in
>then Exchange?
>
>thx
>
>
>--
>PAZ!!
>-=|ߡ?|=-
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (www.grisoft.com).
>Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
 

Re:MAPILogonEx in MS Exchange!

What error do you get back?
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Bit" <XXXX@XXXXX.COM>writes
Quote
thank you Dmitry!

The code below I not obtain to configure profile, wich the problem?
function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
hCurrentBranch:TTreeNode;
pProfAdmin:IPROFADMIN;
pszProfileName:PCHAR;
psNomeServidor,psUsuario:String):HRESULT;
var
hr : HRESULT;
pServices :IMsgServiceAdmin;
pMTServices:IMAPITABLE;
pProviderAdmin:IPROVIDERADMIN;

hService:TTreeNode;

ulRowCount,
ulCount:ULONG;

lpRows :PSRowSet; // Table
lpRow :PSRow; // 1 row from table
lpProp :PSPropValueArray; // 1 Prop (column) from row
Columns:PSPropTagArray;

pInfo : TCItemInfo;

ppProfile:IOpenSectionHack;

label ret;
begin

pServices:=nil;
pMTServices:=nil;
pProviderAdmin:=nil;
ulRowCount:=0;
lpRows :=nil;
lpRow :=nil;
Columns:=nil;
hCurrentBranch.Selected:=True;


hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
s));

if (FAILED(hr)) then
begin
EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
goto ret;
end;

Columns.cValues:=3;
Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;

// Get a service admin interface
hr := pProfAdmin.AdminServices(pszProfileName, // profile name
nil, // no profile password
ULONG(GetActiveWindow()), // parent wnd
0, // Allow UI
pServices); // message service
administration object pointer

if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('AdminServices Failed!');
goto ret;
end;

// Get a table of services in the provider.
hr := pServices.GetMsgServiceTable(0, pMTServices);
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
goto ret;
end;

hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('SetColumns Failed!');
goto ret;
end;


hr := pMTServices.GetRowCount(0, ulRowCount);
if(FAILED(hr)) then
begin
EMAPILogger.LogMessage('GetRowCount Failed!');
goto ret;
end;

// Get all of the rows.
hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
if (FAILED(hr)) then
begin
EMAPILogger.LogMessage('QueryRows Failed!');
goto ret;
end;



MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
Prop));
// Loop through all Services and get the providers for each
lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
lpProp[0].Value.lpszA := PChar(psNomeServidor);
lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
lpProp[1].Value.lpszA := PChar(psUsuario);

//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
hr:=

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
,LPSPropValue(lpProp));

if FAILED(hr) then
begin
EMAPILogger.LogMessage('Configuracao do servidor Failed!');
goto ret;
end;

ret:
if Assigned(lpRows) then FreeProws(lpRows);
if Assigned(pMTServices) then pMTServices:=nil;
if Assigned(pServices) then pServices:=nil; // Released in CItemInfo
if Assigned(Columns) then
MapiFreeBuffer(Columns);

Result:=hr;
end;


"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
news:3f775d2a$XXXX@XXXXX.COM...
>You need to create a temporary profile, populate its data with the name
of
>the server and mailbox, then use the name of the profile to call
>MAPILogonEx(). See Q170225 on MSDN.
>
>Dmitry Streblechenko (MVP)
>www.dimastr.com/
>OutlookSpy - Outlook, CDO
>and MAPI Developer Tool
>
>
>"Bit" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>Hi people,
>>How can logon my inbox without profile in MS Outlook, or either,
direct
in
>>then Exchange?
>>
>>thx
>>
>>
>>--
>>PAZ!!
>>-=|ߡ?|=-
>>
>>
>>---
>>Outgoing mail is certified Virus Free.
>>Checked by AVG anti-virus system (www.grisoft.com).
>>Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
>>
>>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003


 

Re:MAPILogonEx in MS Exchange!

Acess Violation!!
I am wanting to configure profile with name of the server and the user
without showing the box of I dialogue!
hr:=pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0
,0,2,LPSPropValue(lpProp));
Not configure!!
thx
--
PAZ!!
-=|ߡ?|=-
"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
Quote
What error do you get back?

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


"Bit" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>thank you Dmitry!
>
>The code below I not obtain to configure profile, wich the problem?
>function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
>hCurrentBranch:TTreeNode;
>pProfAdmin:IPROFADMIN;
>pszProfileName:PCHAR;
>
psNomeServidor,psUsuario:String):HRESULT;
>var
>hr : HRESULT;
>pServices :IMsgServiceAdmin;
>pMTServices:IMAPITABLE;
>pProviderAdmin:IPROVIDERADMIN;
>
>hService:TTreeNode;
>
>ulRowCount,
>ulCount:ULONG;
>
>lpRows :PSRowSet; // Table
>lpRow :PSRow; // 1 row from table
>lpProp :PSPropValueArray; // 1 Prop (column) from row
>Columns:PSPropTagArray;
>
>pInfo : TCItemInfo;
>
>ppProfile:IOpenSectionHack;
>
>label ret;
>begin
>
>pServices:=nil;
>pMTServices:=nil;
>pProviderAdmin:=nil;
>ulRowCount:=0;
>lpRows :=nil;
>lpRow :=nil;
>Columns:=nil;
>hCurrentBranch.Selected:=True;
>
>

hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
>s));
>
>if (FAILED(hr)) then
>begin
>EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
>goto ret;
>end;
>
>Columns.cValues:=3;
>Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
>Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
>Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
>
>// Get a service admin interface
>hr := pProfAdmin.AdminServices(pszProfileName, // profile name
>nil, // no profile password
>ULONG(GetActiveWindow()), // parent wnd
>0, // Allow UI
>pServices); // message service
>administration object pointer
>
>if(FAILED(hr)) then
>begin
>EMAPILogger.LogMessage('AdminServices Failed!');
>goto ret;
>end;
>
>// Get a table of services in the provider.
>hr := pServices.GetMsgServiceTable(0, pMTServices);
>if(FAILED(hr)) then
>begin
>EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
>goto ret;
>end;
>
>hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
>if(FAILED(hr)) then
>begin
>EMAPILogger.LogMessage('SetColumns Failed!');
>goto ret;
>end;
>
>
>hr := pMTServices.GetRowCount(0, ulRowCount);
>if(FAILED(hr)) then
>begin
>EMAPILogger.LogMessage('GetRowCount Failed!');
>goto ret;
>end;
>
>// Get all of the rows.
>hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
>if (FAILED(hr)) then
>begin
>EMAPILogger.LogMessage('QueryRows Failed!');
>goto ret;
>end;
>
>
>

MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
>Prop));
>// Loop through all Services and get the providers for each
>lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
>lpProp[0].Value.lpszA := PChar(psNomeServidor);
>lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
>lpProp[1].Value.lpszA := PChar(psUsuario);
>
>//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
>hr:=
>

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
>,LPSPropValue(lpProp));
>
>if FAILED(hr) then
>begin
>EMAPILogger.LogMessage('Configuracao do servidor Failed!');
>goto ret;
>end;
>
>ret:
>if Assigned(lpRows) then FreeProws(lpRows);
>if Assigned(pMTServices) then pMTServices:=nil;
>if Assigned(pServices) then pServices:=nil; // Released in CItemInfo
>if Assigned(Columns) then
>MapiFreeBuffer(Columns);
>
>Result:=hr;
>end;
>
>
>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>news:3f775d2a$XXXX@XXXXX.COM...
>>You need to create a temporary profile, populate its data with the
name
of
>>the server and mailbox, then use the name of the profile to call
>>MAPILogonEx(). See Q170225 on MSDN.
>>
>>Dmitry Streblechenko (MVP)
>>www.dimastr.com/
>>OutlookSpy - Outlook, CDO
>>and MAPI Developer Tool
>>
>>
>>"Bit" <XXXX@XXXXX.COM>writes
>>news:XXXX@XXXXX.COM...
>>>Hi people,
>>>How can logon my inbox without profile in MS Outlook, or either,
direct
>in
>>>then Exchange?
>>>
>>>thx
>>>
>>>
>>>--
>>>PAZ!!
>>>-=|ߡ?|=-
>>>
>>>
>>>---
>>>Outgoing mail is certified Virus Free.
>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
>>>
>>>
>>
>>
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (www.grisoft.com).
>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
 

Re:MAPILogonEx in MS Exchange!

I don't think lpRow is initialized, only lpRows is.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Bit" <XXXX@XXXXX.COM>writes
Quote
Acess Violation!!

I am wanting to configure profile with name of the server and the user
without showing the box of I dialogue!


hr:=pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0
,0,2,LPSPropValue(lpProp));

Not configure!!

thx


--
PAZ!!
-=|ߡ?|=-

"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
news:3f78aba7$XXXX@XXXXX.COM...
>What error do you get back?
>
>Dmitry Streblechenko (MVP)
>www.dimastr.com/
>OutlookSpy - Outlook, CDO
>and MAPI Developer Tool
>
>
>"Bit" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>thank you Dmitry!
>>
>>The code below I not obtain to configure profile, wich the problem?
>>function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
>>hCurrentBranch:TTreeNode;
>>pProfAdmin:IPROFADMIN;
>>pszProfileName:PCHAR;
>>
psNomeServidor,psUsuario:String):HRESULT;
>>var
>>hr : HRESULT;
>>pServices :IMsgServiceAdmin;
>>pMTServices:IMAPITABLE;
>>pProviderAdmin:IPROVIDERADMIN;
>>
>>hService:TTreeNode;
>>
>>ulRowCount,
>>ulCount:ULONG;
>>
>>lpRows :PSRowSet; // Table
>>lpRow :PSRow; // 1 row from table
>>lpProp :PSPropValueArray; // 1 Prop (column) from row
>>Columns:PSPropTagArray;
>>
>>pInfo : TCItemInfo;
>>
>>ppProfile:IOpenSectionHack;
>>
>>label ret;
>>begin
>>
>>pServices:=nil;
>>pMTServices:=nil;
>>pProviderAdmin:=nil;
>>ulRowCount:=0;
>>lpRows :=nil;
>>lpRow :=nil;
>>Columns:=nil;
>>hCurrentBranch.Selected:=True;
>>
>>
>

hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
>>s));
>>
>>if (FAILED(hr)) then
>>begin
>>EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
>>goto ret;
>>end;
>>
>>Columns.cValues:=3;
>>Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
>>Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
>>Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
>>
>>// Get a service admin interface
>>hr := pProfAdmin.AdminServices(pszProfileName, // profile name
>>nil, // no profile password
>>ULONG(GetActiveWindow()), // parent
wnd
>>0, // Allow UI
>>pServices); // message service
>>administration object pointer
>>
>>if(FAILED(hr)) then
>>begin
>>EMAPILogger.LogMessage('AdminServices Failed!');
>>goto ret;
>>end;
>>
>>// Get a table of services in the provider.
>>hr := pServices.GetMsgServiceTable(0, pMTServices);
>>if(FAILED(hr)) then
>>begin
>>EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
>>goto ret;
>>end;
>>
>>hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
>>if(FAILED(hr)) then
>>begin
>>EMAPILogger.LogMessage('SetColumns Failed!');
>>goto ret;
>>end;
>>
>>
>>hr := pMTServices.GetRowCount(0, ulRowCount);
>>if(FAILED(hr)) then
>>begin
>>EMAPILogger.LogMessage('GetRowCount Failed!');
>>goto ret;
>>end;
>>
>>// Get all of the rows.
>>hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
>>if (FAILED(hr)) then
>>begin
>>EMAPILogger.LogMessage('QueryRows Failed!');
>>goto ret;
>>end;
>>
>>
>>
>

MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
>>Prop));
>>// Loop through all Services and get the providers for each
>>lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
>>lpProp[0].Value.lpszA := PChar(psNomeServidor);
>>lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
>>lpProp[1].Value.lpszA := PChar(psUsuario);
>>
>>//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
>>hr:=
>>
>

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
>>,LPSPropValue(lpProp));
>>
>>if FAILED(hr) then
>>begin
>>EMAPILogger.LogMessage('Configuracao do servidor Failed!');
>>goto ret;
>>end;
>>
>>ret:
>>if Assigned(lpRows) then FreeProws(lpRows);
>>if Assigned(pMTServices) then pMTServices:=nil;
>>if Assigned(pServices) then pServices:=nil; // Released in
CItemInfo
>>if Assigned(Columns) then
>>MapiFreeBuffer(Columns);
>>
>>Result:=hr;
>>end;
>>
>>
>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>news:3f775d2a$XXXX@XXXXX.COM...
>>>You need to create a temporary profile, populate its data with the
name
>of
>>>the server and mailbox, then use the name of the profile to call
>>>MAPILogonEx(). See Q170225 on MSDN.
>>>
>>>Dmitry Streblechenko (MVP)
>>>www.dimastr.com/
>>>OutlookSpy - Outlook, CDO
>>>and MAPI Developer Tool
>>>
>>>
>>>"Bit" <XXXX@XXXXX.COM>writes
>>>news:XXXX@XXXXX.COM...
>>>>Hi people,
>>>>How can logon my inbox without profile in MS Outlook, or either,
>direct
>>in
>>>>then Exchange?
>>>>
>>>>thx
>>>>
>>>>
>>>>--
>>>>PAZ!!
>>>>-=|ߡ?|=-
>>>>
>>>>
>>>>---
>>>>Outgoing mail is certified Virus Free.
>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
>>>>
>>>>
>>>
>>>
>>
>>
>>---
>>Outgoing mail is certified Virus Free.
>>Checked by AVG anti-virus system (www.grisoft.com).
>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>
>>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003


 

Re:MAPILogonEx in MS Exchange!

Thank you!
I modified code, the error not occur but no arrives to configure the server
and user name, what you the made a mistake one?
hr:=
pServices.ConfigureMsgService(PMAPIUID(lpRows.aRow[0].lpProps[0].value.bin.l
pb),0,0,1,PSPropValue(lpProp));
--
PAZ!!
-=|ߡ?|=-
"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
Quote
I don't think lpRow is initialized, only lpRows is.

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


"Bit" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Acess Violation!!
>
>I am wanting to configure profile with name of the server and the user
>without showing the box of I dialogue!
>
>

hr:=pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0
>,0,2,LPSPropValue(lpProp));
>
>Not configure!!
>
>thx
>
>
>--
>PAZ!!
>-=|ߡ?|=-
>
>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>news:3f78aba7$XXXX@XXXXX.COM...
>>What error do you get back?
>>
>>Dmitry Streblechenko (MVP)
>>www.dimastr.com/
>>OutlookSpy - Outlook, CDO
>>and MAPI Developer Tool
>>
>>
>>"Bit" <XXXX@XXXXX.COM>writes
>>news:XXXX@XXXXX.COM...
>>>thank you Dmitry!
>>>
>>>The code below I not obtain to configure profile, wich the problem?
>>>function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
>>>hCurrentBranch:TTreeNode;
>>>pProfAdmin:IPROFADMIN;
>>>pszProfileName:PCHAR;
>>>
>psNomeServidor,psUsuario:String):HRESULT;
>>>var
>>>hr : HRESULT;
>>>pServices :IMsgServiceAdmin;
>>>pMTServices:IMAPITABLE;
>>>pProviderAdmin:IPROVIDERADMIN;
>>>
>>>hService:TTreeNode;
>>>
>>>ulRowCount,
>>>ulCount:ULONG;
>>>
>>>lpRows :PSRowSet; // Table
>>>lpRow :PSRow; // 1 row from table
>>>lpProp :PSPropValueArray; // 1 Prop (column) from row
>>>Columns:PSPropTagArray;
>>>
>>>pInfo : TCItemInfo;
>>>
>>>ppProfile:IOpenSectionHack;
>>>
>>>label ret;
>>>begin
>>>
>>>pServices:=nil;
>>>pMTServices:=nil;
>>>pProviderAdmin:=nil;
>>>ulRowCount:=0;
>>>lpRows :=nil;
>>>lpRow :=nil;
>>>Columns:=nil;
>>>hCurrentBranch.Selected:=True;
>>>
>>>
>>
>

hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
>>>s));
>>>
>>>if (FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
>>>goto ret;
>>>end;
>>>
>>>Columns.cValues:=3;
>>>Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
>>>Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
>>>Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
>>>
>>>// Get a service admin interface
>>>hr := pProfAdmin.AdminServices(pszProfileName, // profile name
>>>nil, // no profile password
>>>ULONG(GetActiveWindow()), // parent
wnd
>>>0, // Allow UI
>>>pServices); // message service
>>>administration object pointer
>>>
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('AdminServices Failed!');
>>>goto ret;
>>>end;
>>>
>>>// Get a table of services in the provider.
>>>hr := pServices.GetMsgServiceTable(0, pMTServices);
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
>>>goto ret;
>>>end;
>>>
>>>hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('SetColumns Failed!');
>>>goto ret;
>>>end;
>>>
>>>
>>>hr := pMTServices.GetRowCount(0, ulRowCount);
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('GetRowCount Failed!');
>>>goto ret;
>>>end;
>>>
>>>// Get all of the rows.
>>>hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
>>>if (FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('QueryRows Failed!');
>>>goto ret;
>>>end;
>>>
>>>
>>>
>>
>

MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
>>>Prop));
>>>// Loop through all Services and get the providers for each
>>>lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
>>>lpProp[0].Value.lpszA := PChar(psNomeServidor);
>>>lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
>>>lpProp[1].Value.lpszA := PChar(psUsuario);
>>>
>>>//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
>>>hr:=
>>>
>>
>

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
>>>,LPSPropValue(lpProp));
>>>
>>>if FAILED(hr) then
>>>begin
>>>EMAPILogger.LogMessage('Configuracao do servidor Failed!');
>>>goto ret;
>>>end;
>>>
>>>ret:
>>>if Assigned(lpRows) then FreeProws(lpRows);
>>>if Assigned(pMTServices) then pMTServices:=nil;
>>>if Assigned(pServices) then pServices:=nil; // Released in
CItemInfo
>>>if Assigned(Columns) then
>>>MapiFreeBuffer(Columns);
>>>
>>>Result:=hr;
>>>end;
>>>
>>>
>>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>>news:3f775d2a$XXXX@XXXXX.COM...
>>>>You need to create a temporary profile, populate its data with the
>name
>>of
>>>>the server and mailbox, then use the name of the profile to call
>>>>MAPILogonEx(). See Q170225 on MSDN.
>>>>
>>>>Dmitry Streblechenko (MVP)
>>>>www.dimastr.com/
>>>>OutlookSpy - Outlook, CDO
>>>>and MAPI Developer Tool
>>>>
>>>>
>>>>"Bit" <XXXX@XXXXX.COM>writes
>>>>news:XXXX@XXXXX.COM...
>>>>>Hi people,
>>>>>How can logon my inbox without profile in MS Outlook, or either,
>>direct
>>>in
>>>>>then Exchange?
>>>>>
>>>>>thx
>>>>>
>>>>>
>>>>>--
>>>>>PAZ!!
>>>>>-=|ߡ?|=-
>>>>>
>>>>>
>>>>>---
>>>>>Outgoing mail is certified Virus Free.
>>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>>Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>---
>>>Outgoing mail is certified Virus Free.
>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>>
>>>
>>
>>
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (www.grisoft.com).
>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>
>


Thank you!
I modified code, the error not occur but no arrives to configure the server
and user name, what you the made a mistake one?
hr:=
pServices.ConfigureMsgService(PMAPIUID(lpRows.aRow[0].lpProps[0].value.bin.l
pb),0,0,1,PSPropValue(lpProp));
--
PAZ!!
-=|ߡ?|=-
"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
Quote
I don't think lpRow is initialized, only lpRows is.

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


"Bit" <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Acess Violation!!
>
>I am wanting to configure profile with name of the server and the user
>without showing the box of I dialogue!
>
>

hr:=pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0
>,0,2,LPSPropValue(lpProp));
>
>Not configure!!
>
>thx
>
>
>--
>PAZ!!
>-=|ߡ?|=-
>
>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>news:3f78aba7$XXXX@XXXXX.COM...
>>What error do you get back?
>>
>>Dmitry Streblechenko (MVP)
>>www.dimastr.com/
>>OutlookSpy - Outlook, CDO
>>and MAPI Developer Tool
>>
>>
>>"Bit" <XXXX@XXXXX.COM>writes
>>news:XXXX@XXXXX.COM...
>>>thank you Dmitry!
>>>
>>>The code below I not obtain to configure profile, wich the problem?
>>>function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
>>>hCurrentBranch:TTreeNode;
>>>pProfAdmin:IPROFADMIN;
>>>pszProfileName:PCHAR;
>>>
>psNomeServidor,psUsuario:String):HRESULT;
>>>var
>>>hr : HRESULT;
>>>pServices :IMsgServiceAdmin;
>>>pMTServices:IMAPITABLE;
>>>pProviderAdmin:IPROVIDERADMIN;
>>>
>>>hService:TTreeNode;
>>>
>>>ulRowCount,
>>>ulCount:ULONG;
>>>
>>>lpRows :PSRowSet; // Table
>>>lpRow :PSRow; // 1 row from table
>>>lpProp :PSPropValueArray; // 1 Prop (column) from row
>>>Columns:PSPropTagArray;
>>>
>>>pInfo : TCItemInfo;
>>>
>>>ppProfile:IOpenSectionHack;
>>>
>>>label ret;
>>>begin
>>>
>>>pServices:=nil;
>>>pMTServices:=nil;
>>>pProviderAdmin:=nil;
>>>ulRowCount:=0;
>>>lpRows :=nil;
>>>lpRow :=nil;
>>>Columns:=nil;
>>>hCurrentBranch.Selected:=True;
>>>
>>>
>>
>

hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
>>>s));
>>>
>>>if (FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
>>>goto ret;
>>>end;
>>>
>>>Columns.cValues:=3;
>>>Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
>>>Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
>>>Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
>>>
>>>// Get a service admin interface
>>>hr := pProfAdmin.AdminServices(pszProfileName, // profile name
>>>nil, // no profile password
>>>ULONG(GetActiveWindow()), // parent
wnd
>>>0, // Allow UI
>>>pServices); // message service
>>>administration object pointer
>>>
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('AdminServices Failed!');
>>>goto ret;
>>>end;
>>>
>>>// Get a table of services in the provider.
>>>hr := pServices.GetMsgServiceTable(0, pMTServices);
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
>>>goto ret;
>>>end;
>>>
>>>hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('SetColumns Failed!');
>>>goto ret;
>>>end;
>>>
>>>
>>>hr := pMTServices.GetRowCount(0, ulRowCount);
>>>if(FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('GetRowCount Failed!');
>>>goto ret;
>>>end;
>>>
>>>// Get all of the rows.
>>>hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
>>>if (FAILED(hr)) then
>>>begin
>>>EMAPILogger.LogMessage('QueryRows Failed!');
>>>goto ret;
>>>end;
>>>
>>>
>>>
>>
>

MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
>>>Prop));
>>>// Loop through all Services and get the providers for each
>>>lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
>>>lpProp[0].Value.lpszA := PChar(psNomeServidor);
>>>lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
>>>lpProp[1].Value.lpszA := PChar(psUsuario);
>>>
>>>//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
>>>hr:=
>>>
>>
>

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
>>>,LPSPropValue(lpProp));
>>>
>>>if FAILED(hr) then
>>>begin
>>>EMAPILogger.LogMessage('Configuracao do servidor Failed!');
>>>goto ret;
>>>end;
>>>
>>>ret:
>>>if Assigned(lpRows) then FreeProws(lpRows);
>>>if Assigned(pMTServices) then pMTServices:=nil;
>>>if Assigned(pServices) then pServices:=nil; // Released in
CItemInfo
>>>if Assigned(Columns) then
>>>MapiFreeBuffer(Columns);
>>>
>>>Result:=hr;
>>>end;
>>>
>>>
>>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>>news:3f775d2a$XXXX@XXXXX.COM...
>>>>You need to create a temporary profile, populate its data with the
>name
>>of
>>>>the server and mailbox, then use the name of the profile to call
>>>>MAPILogonEx(). See Q170225 on MSDN.
>>>>
>>>>Dmitry Streblechenko (MVP)
>>>>www.dimastr.com/
>>>>OutlookSpy - Outlook, CDO
>>>>and MAPI Developer Tool
>>>>
>>>>
>>>>"Bit" <XXXX@XXXXX.COM>writes
>>>>news:XXXX@XXXXX.COM...
>>>>>Hi people,
>>>>>How can logon my inbox without profile in MS Outlook, or either,
>>direct
>>>in
>>>>>then Exchange?
>>>>>
>>>>>thx
>>>>>
>>>>>
>>>>>--
>>>>>PAZ!!
>>>>>-=|ߡ?|=-
>>>>>
>>>>>
>>>>>---
>>>>>Outgoing mail is certified Virus Free.
>>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>>Version: 6.0.521 / Virus Database: 319 - Release Date: 23/9/2003
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>---
>>>Outgoing mail is certified Virus Free.
>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>>
>>>
>>
>>
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (www.grisoft.com).
>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>
>


 

Re:MAPILogonEx in MS Exchange!

I am not sure I understand. Why do you use 1 instead of 2? You need to pass
both the server name and the mailbox name.
Dmitry Streblechenko (MVP)
www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Bit" <XXXX@XXXXX.COM>writes
Quote
Thank you!

I modified code, the error not occur but no arrives to configure the
server
and user name, what you the made a mistake one?

hr:=

pServices.ConfigureMsgService(PMAPIUID(lpRows.aRow[0].lpProps[0].value.bin.l
pb),0,0,1,PSPropValue(lpProp));


--
PAZ!!
-=|ߡ?|=-

"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
news:XXXX@XXXXX.COM...
>I don't think lpRow is initialized, only lpRows is.
>
>Dmitry Streblechenko (MVP)
>www.dimastr.com/
>OutlookSpy - Outlook, CDO
>and MAPI Developer Tool
>
>
>"Bit" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>Acess Violation!!
>>
>>I am wanting to configure profile with name of the server and the user
>>without showing the box of I dialogue!
>>
>>
>

hr:=pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0
>>,0,2,LPSPropValue(lpProp));
>>
>>Not configure!!
>>
>>thx
>>
>>
>>--
>>PAZ!!
>>-=|ߡ?|=-
>>
>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>news:3f78aba7$XXXX@XXXXX.COM...
>>>What error do you get back?
>>>
>>>Dmitry Streblechenko (MVP)
>>>www.dimastr.com/
>>>OutlookSpy - Outlook, CDO
>>>and MAPI Developer Tool
>>>
>>>
>>>"Bit" <XXXX@XXXXX.COM>writes
>>>news:XXXX@XXXXX.COM...
>>>>thank you Dmitry!
>>>>
>>>>The code below I not obtain to configure profile, wich the
problem?
>>>>function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
>>>>hCurrentBranch:TTreeNode;
>>>>pProfAdmin:IPROFADMIN;
>>>>pszProfileName:PCHAR;
>>>>
>>psNomeServidor,psUsuario:String):HRESULT;
>>>>var
>>>>hr : HRESULT;
>>>>pServices :IMsgServiceAdmin;
>>>>pMTServices:IMAPITABLE;
>>>>pProviderAdmin:IPROVIDERADMIN;
>>>>
>>>>hService:TTreeNode;
>>>>
>>>>ulRowCount,
>>>>ulCount:ULONG;
>>>>
>>>>lpRows :PSRowSet; // Table
>>>>lpRow :PSRow; // 1 row from table
>>>>lpProp :PSPropValueArray; // 1 Prop (column) from row
>>>>Columns:PSPropTagArray;
>>>>
>>>>pInfo : TCItemInfo;
>>>>
>>>>ppProfile:IOpenSectionHack;
>>>>
>>>>label ret;
>>>>begin
>>>>
>>>>pServices:=nil;
>>>>pMTServices:=nil;
>>>>pProviderAdmin:=nil;
>>>>ulRowCount:=0;
>>>>lpRows :=nil;
>>>>lpRow :=nil;
>>>>Columns:=nil;
>>>>hCurrentBranch.Selected:=True;
>>>>
>>>>
>>>
>>
>

hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
>>>>s));
>>>>
>>>>if (FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>Columns.cValues:=3;
>>>>Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
>>>>Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
>>>>Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
>>>>
>>>>// Get a service admin interface
>>>>hr := pProfAdmin.AdminServices(pszProfileName, // profile name
>>>>nil, // no profile password
>>>>ULONG(GetActiveWindow()), //
parent
>wnd
>>>>0, // Allow UI
>>>>pServices); // message service
>>>>administration object pointer
>>>>
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('AdminServices Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>// Get a table of services in the provider.
>>>>hr := pServices.GetMsgServiceTable(0, pMTServices);
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('SetColumns Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>
>>>>hr := pMTServices.GetRowCount(0, ulRowCount);
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('GetRowCount Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>// Get all of the rows.
>>>>hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
>>>>if (FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('QueryRows Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>
>>>>
>>>
>>
>

MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
>>>>Prop));
>>>>// Loop through all Services and get the providers for each
>>>>lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
>>>>lpProp[0].Value.lpszA := PChar(psNomeServidor);
>>>>lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
>>>>lpProp[1].Value.lpszA := PChar(psUsuario);
>>>>
>>>>//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
>>>>hr:=
>>>>
>>>
>>
>

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
>>>>,LPSPropValue(lpProp));
>>>>
>>>>if FAILED(hr) then
>>>>begin
>>>>EMAPILogger.LogMessage('Configuracao do servidor Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>ret:
>>>>if Assigned(lpRows) then FreeProws(lpRows);
>>>>if Assigned(pMTServices) then pMTServices:=nil;
>>>>if Assigned(pServices) then pServices:=nil; // Released in
>CItemInfo
>>>>if Assigned(Columns) then
>>>>MapiFreeBuffer(Columns);
>>>>
>>>>Result:=hr;
>>>>end;
>>>>
>>>>
>>>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>>>news:3f775d2a$XXXX@XXXXX.COM...
>>>>>You need to create a temporary profile, populate its data with
the
>>name
>>>of
>>>>>the server and mailbox, then use the name of the profile to call
>>>>>MAPILogonEx(). See Q170225 on MSDN.
>>>>>
>>>>>Dmitry Streblechenko (MVP)
>>>>>www.dimastr.com/
>>>>>OutlookSpy - Outlook, CDO
>>>>>and MAPI Developer Tool
>>>>>
>>>>>
>>>>>"Bit" <XXXX@XXXXX.COM>writes
>>>>>news:XXXX@XXXXX.COM...
>>>>>>Hi people,
>>>>>>How can logon my inbox without profile in MS Outlook, or
either,
>>>direct
>>>>in
>>>>>>then Exchange?
>>>>>>
>>>>>>thx
>>>>>>
>>>>>>
>>>>>>--
>>>>>>PAZ!!
>>>>>>-=|ߡ?|=-
>>>>>>
>>>>>>
>>>>>>---
>>>>>>Outgoing mail is certified Virus Free.
>>>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>>>Version: 6.0.521 / Virus Database: 319 - Release Date:
23/9/2003
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>---
>>>>Outgoing mail is certified Virus Free.
>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>>>
>>>>
>>>
>>>
>>
>>
>>---
>>Outgoing mail is certified Virus Free.
>>Checked by AVG anti-virus system (www.grisoft.com).
>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>
>>
>
>
Thank you!

I modified code, the error not occur but no arrives to configure the
server
and user name, what you the made a mistake one?

hr:=

pServices.ConfigureMsgService(PMAPIUID(lpRows.aRow[0].lpProps[0].value.bin.l
pb),0,0,1,PSPropValue(lpProp));


--
PAZ!!
-=|ߡ?|=-

"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
news:XXXX@XXXXX.COM...
>I don't think lpRow is initialized, only lpRows is.
>
>Dmitry Streblechenko (MVP)
>www.dimastr.com/
>OutlookSpy - Outlook, CDO
>and MAPI Developer Tool
>
>
>"Bit" <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>Acess Violation!!
>>
>>I am wanting to configure profile with name of the server and the user
>>without showing the box of I dialogue!
>>
>>
>

hr:=pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0
>>,0,2,LPSPropValue(lpProp));
>>
>>Not configure!!
>>
>>thx
>>
>>
>>--
>>PAZ!!
>>-=|ߡ?|=-
>>
>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>news:3f78aba7$XXXX@XXXXX.COM...
>>>What error do you get back?
>>>
>>>Dmitry Streblechenko (MVP)
>>>www.dimastr.com/
>>>OutlookSpy - Outlook, CDO
>>>and MAPI Developer Tool
>>>
>>>
>>>"Bit" <XXXX@XXXXX.COM>writes
>>>news:XXXX@XXXXX.COM...
>>>>thank you Dmitry!
>>>>
>>>>The code below I not obtain to configure profile, wich the
problem?
>>>>function TCProfiles.ConfigureServerExchange(var pTree:TTreeView;
>>>>hCurrentBranch:TTreeNode;
>>>>pProfAdmin:IPROFADMIN;
>>>>pszProfileName:PCHAR;
>>>>
>>psNomeServidor,psUsuario:String):HRESULT;
>>>>var
>>>>hr : HRESULT;
>>>>pServices :IMsgServiceAdmin;
>>>>pMTServices:IMAPITABLE;
>>>>pProviderAdmin:IPROVIDERADMIN;
>>>>
>>>>hService:TTreeNode;
>>>>
>>>>ulRowCount,
>>>>ulCount:ULONG;
>>>>
>>>>lpRows :PSRowSet; // Table
>>>>lpRow :PSRow; // 1 row from table
>>>>lpProp :PSPropValueArray; // 1 Prop (column) from row
>>>>Columns:PSPropTagArray;
>>>>
>>>>pInfo : TCItemInfo;
>>>>
>>>>ppProfile:IOpenSectionHack;
>>>>
>>>>label ret;
>>>>begin
>>>>
>>>>pServices:=nil;
>>>>pMTServices:=nil;
>>>>pProviderAdmin:=nil;
>>>>ulRowCount:=0;
>>>>lpRows :=nil;
>>>>lpRow :=nil;
>>>>Columns:=nil;
>>>>hCurrentBranch.Selected:=True;
>>>>
>>>>
>>>
>>
>

hr:=MapiAllocateBuffer(Sizeof(TSPropTagArray)+Sizeof(ULONG)*2,Pointer(Column
>>>>s));
>>>>
>>>>if (FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('MapiAllocateBuffer Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>Columns.cValues:=3;
>>>>Columns.aulPropTag[Columns.cValues-3]:=PR_DISPLAY_NAME;
>>>>Columns.aulPropTag[Columns.cValues-2]:=PR_SERVICE_NAME;
>>>>Columns.aulPropTag[Columns.cValues-1]:=PR_INSTANCE_KEY;
>>>>
>>>>// Get a service admin interface
>>>>hr := pProfAdmin.AdminServices(pszProfileName, // profile name
>>>>nil, // no profile password
>>>>ULONG(GetActiveWindow()), //
parent
>wnd
>>>>0, // Allow UI
>>>>pServices); // message service
>>>>administration object pointer
>>>>
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('AdminServices Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>// Get a table of services in the provider.
>>>>hr := pServices.GetMsgServiceTable(0, pMTServices);
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('GetMsgServiceTable Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>hr := pMTServices.SetColumns(PSPropTagArray(Columns), 0);
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('SetColumns Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>
>>>>hr := pMTServices.GetRowCount(0, ulRowCount);
>>>>if(FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('GetRowCount Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>// Get all of the rows.
>>>>hr := pMTServices.QueryRows(ulRowCount, 0, lpRows);
>>>>if (FAILED(hr)) then
>>>>begin
>>>>EMAPILogger.LogMessage('QueryRows Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>
>>>>
>>>
>>
>

MAPIAllocateBuffer(sizeof(TSPropValueArray)+sizeof(TSPropValue)*2,Pointer(lp
>>>>Prop));
>>>>// Loop through all Services and get the providers for each
>>>>lpProp[0].ulPropTag := PR_PROFILE_UNRESOLVED_SERVER;
>>>>lpProp[0].Value.lpszA := PChar(psNomeServidor);
>>>>lpProp[1].ulPropTag := PR_PROFILE_UNRESOLVED_NAME;
>>>>lpProp[1].Value.lpszA := PChar(psUsuario);
>>>>
>>>>//THIS IS ROUTINE NOT CONFIGURE, ERROR!!!
>>>>hr:=
>>>>
>>>
>>
>

pServices.ConfigureMsgService(PMAPIUID(lpRow.lpProps[0].Value.bin.lpb),0,0,2
>>>>,LPSPropValue(lpProp));
>>>>
>>>>if FAILED(hr) then
>>>>begin
>>>>EMAPILogger.LogMessage('Configuracao do servidor Failed!');
>>>>goto ret;
>>>>end;
>>>>
>>>>ret:
>>>>if Assigned(lpRows) then FreeProws(lpRows);
>>>>if Assigned(pMTServices) then pMTServices:=nil;
>>>>if Assigned(pServices) then pServices:=nil; // Released in
>CItemInfo
>>>>if Assigned(Columns) then
>>>>MapiFreeBuffer(Columns);
>>>>
>>>>Result:=hr;
>>>>end;
>>>>
>>>>
>>>>"Dmitry Streblechenko" <XXXX@XXXXX.COM>escreveu na mensagem
>>>>news:3f775d2a$XXXX@XXXXX.COM...
>>>>>You need to create a temporary profile, populate its data with
the
>>name
>>>of
>>>>>the server and mailbox, then use the name of the profile to call
>>>>>MAPILogonEx(). See Q170225 on MSDN.
>>>>>
>>>>>Dmitry Streblechenko (MVP)
>>>>>www.dimastr.com/
>>>>>OutlookSpy - Outlook, CDO
>>>>>and MAPI Developer Tool
>>>>>
>>>>>
>>>>>"Bit" <XXXX@XXXXX.COM>writes
>>>>>news:XXXX@XXXXX.COM...
>>>>>>Hi people,
>>>>>>How can logon my inbox without profile in MS Outlook, or
either,
>>>direct
>>>>in
>>>>>>then Exchange?
>>>>>>
>>>>>>thx
>>>>>>
>>>>>>
>>>>>>--
>>>>>>PAZ!!
>>>>>>-=|ߡ?|=-
>>>>>>
>>>>>>
>>>>>>---
>>>>>>Outgoing mail is certified Virus Free.
>>>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>>>Version: 6.0.521 / Virus Database: 319 - Release Date:
23/9/2003
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>---
>>>>Outgoing mail is certified Virus Free.
>>>>Checked by AVG anti-virus system (www.grisoft.com).
>>>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>>>
>>>>
>>>
>>>
>>
>>
>>---
>>Outgoing mail is certified Virus Free.
>>Checked by AVG anti-virus system (www.grisoft.com).
>>Version: 6.0.522 / Virus Database: 320 - Release Date: 29/9/2003
>>
>>
>
>