Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Aug : MAPI handle problem.

www.cryer.info
Managed Newsgroup Archive

MAPI handle problem.

Subject:MAPI handle problem.
Posted by:"Mark Williams" (mark@{removethis}skwirel.com)
Date:Thu, 25 Aug 2005 13:31:43 +0100

Hi,

I posted this problem on the ActiveX group over a month ago, but no-one has
replied, so I assume no-one on that group knows the answer to this one.

I'm calling default mail agent using MAPI from within an Activeform.  This
works fine provided the ActiveX is deployed in a browser.  However, when you
deploy the ActiveX from, for example another Delphi application, it comes up
with a peculiar error.

Using Outlook Express, it opens Outlook Express modally  and the whole of
Outlook Express is frozen, except for the "To" field, which you can edit to
your
heart's content, but that's all that you can use.

I'm aware that you have to be careful about the handle chosen for a MAPI
call, but I would have assumed that if you pass the wrong handle the whole
of OutLook Express would be frozen.

I pass Application.Handle as the handle for the MAPI call, which
works fine with the ActiveX in IE.

I guess I need to pass the handle of the host application in all other
instances.

Can anyone please enlighten me on this?

I've looked at ClientSite and InPlaceSite to see if I can work out whether
I'm in a browser or not and, if not, what is the handle of the host
application, but I've not really been able to figure it out.

Any help, suggestions, code snippets would be really appreciated.

TIA,

Mark Williams

Info

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive