at the moment i'm writing a COM-Addin in C#. I need to get the actual
profile name.
With this line: Application.Session.CurrentUser.Name i can get the
profile name with Outlook 2007.
Unfortunately that doesn't work with Outlook 2003.
As a workaround i thought i write a Delphi DLL where i get the actual
profile name with extended MAPI.
My question is if it is possible to pass
Application.Session.MAPIOBJECT to the Delphi DLL. How can
i archieve this?
Greets Hans
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Hans Schmidt" <suffp...@googlemail.com> wrote in message
news:ff8b1bff-dd48-46ec...@m1g2000vbi.googlegroups.com...
do you have or anyone else an example how to get the IUnknown from
Application.Session.MAPIOBJECT? I can't find IUnknown in C#.
Greets Hans
On 23 Okt., 18:46, "Dmitry Streblechenko" <dmi...@dimastr.com> wrote:
> Pass it as IUnknown, then in your Delphi code QI it for IMAPISession.
>
> --
> Dmitry Streblechenko (MVP)http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
> -"Hans Schmidt" <suffpor...@googlemail.com> wrote in message
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Hans Schmidt" <suffp...@googlemail.com> wrote in message
news:3bc5dd29-bfac-491d...@p36g2000vbn.googlegroups.com...
procedure getProfile(Intf: IUnknown); stdcall;
const
pbGlobalProfileSectionGuid : TMAPIUID = (ab:($13,$DB,$B0,$C8,$AA,
$05,$10,$1A,$9B,$B0,$00,$AA,$00,$2F,$C4,$5A));
var
lppprofsect : Iprofsect;
propProfile : PSPropValue;
value : String;
hr : Hresult;
session : IMapiSession;
begin
value:='';
Intf.QueryInterface(IID_IMAPISession, session);
hr:=session.OpenProfileSection(PMAPIUID
(@pbGlobalProfileSectionGuid),IID_IProfSect,MAPI_MODIFY, lppProfSect);
if (hr = S_OK) then
begin
propprofile:=nil;
if (S_OK = HrGetOneProp(lppprofsect, PR_PROFILE_NAME,
propProfile)) then
value:=propprofile.value.lpsza;
if assigned(propprofile) then
mapifreebuffer(propprofile);
propprofile:=nil;
end
else
if (hr<>S_OK) then
begin
end;
lppProfSect:=nil;
ShowMessage(value);
end;
Passing the IUnknown works but while doing this:
Intf.QueryInterface(IID_IMAPISession, session);
i get a MAPI_E_CALL_FAILED error.
Does anyone know why?
Greets Hans
On 26 Okt., 18:35, "Dmitry Streblechenko" <dmi...@dimastr.com> wrote:
> Declare it as object in .Net.
> In your Delphi COM object OleVariant would work sure, IUnknown should alse
> work I think.
>
> --
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Hans Schmidt" <suffp...@googlemail.com> wrote in message
news:663b0b7c-da50-4f98...@f16g2000yqm.googlegroups.com...
the solution was to call MapiInitialize. Now, everything works fine.
Greets Hans
the
On 27 Okt., 19:25, "Dmitry Streblechenko" <dmi...@dimastr.com> wrote:
> Is that in in-proc or out-of-proc executable? In the latter case, you must
> call MAPIInitialize first.
>
> --