Re: How to send a mail from app, without blocking APP!?



Well see never mind,
I have my own cMAPI class now, that incorporates MAPI API (USING VC Declare rather than VB<-that doesn't work),
still I can't make it work without APP MODAL, it seams to me that UIParam argument in all functions has to be pointer to CWnd class
or something that VB doesn't support. I can't find any details with sample code on this argument, how application will behave if
this argument is passed or not, cause in my case if I pass hWnd or 0 it is same result. I must be missing something.

But:
- I don't have to include MSMAPI32.OCX in my installation;
- my app in background seams to be working fine in other threads (some network communication);

If user still wants to get some info from App he will need to get that info first and than send mail, or close compose window get
info end start compose again.
I don't want to loose more time on this - now it seams to me like impossible task, I can bet that MS support would say "It is by
Design", but still I know that compose in OE doesn't block main window so than it should not block my App, but...
If I could write my own mapi32.dll, I would only remove only WaitForSingleObject from original source or make it conditional q=)

Anyway thanks for all your help

[SolarAngel]


"Mark Yudkin" <myudkinATcompuserveDOTcom@xxxxxxxxx> wrote in message news:#yyYlIUfFHA.1416@xxxxxxxxxxxxxxxxxxxxxxx
| As the MS documentation indicates, CDOSYS is available from Windows 2000 up.
| It is not available on NT4 (that's CDONT, being CDO v1.x - see my earlier
| post). If you have to support NT4 from the same source, then you may have a
| problem.
|
| Your code:
| > Set oSes = CreateObject("MAPI.Session")
| > Set oSes = New MAPI.Session
| is not CDOSYS, but MAPI. MAPI is no longer part of Windows as of Windows
| 2000, and you have to install Outlook to get it. See KB254458 and KB314491,
| which also state "Microsoft recommends that vendors upgrade their programs
| to use Collaboration Data Objects (CDO)." (as per my initial response).
|
| "[SolarAngel]" <not-for-mail> wrote in message
| news:ukwGBdIfFHA.3304@xxxxxxxxxxxxxxxxxxxxxxx
| >I have started reading article you have specified,
| > but one thing interests me is this DLL shipped & supported on XP and other
| > NT OS's!?
| > also
| >
| > Set oSes = CreateObject("MAPI.Session")
| > Set oSes = New MAPI.Session
| >
| > always return Automation Error 0x80004005!?
| >
| > It seams to me that client will have to have something installed on his OS
| > like Exchange!?
| >
| > [SolarAngel]
| >
| >
| > "Mark Yudkin" <myudkinATcompuserveDOTcom@xxxxxxxxx> wrote in message
| > news:eHvx1$GfFHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
| > | MAPI is a very "awkward" API for this sort of thing. It's designed to do
| > | exactly what you're seeing, and is very specifically and deliberately
| > | designed not to do what you want (no, I don't know why). Use CDOSYS (CDO
| > | V2+) - it was designed to support the sort of unattended e-mail you'd
| > like
| > | (W2K and above). [CDO 1.x is merely an API over MAPI]
| > |
| > | Documentation is in the Platform SDK under "Message and Collaboration -
| > | Collaboration Data Objects"
| > |
| > | "[SolarAngel]" <not-for-mail> wrote in message
| > | news:OLCA707eFHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
| > | >I have tried with Simple MAPI, MAPI, MAPI32 API (from
| > | >MSVS\VC98\Include\Mapivb.bas - also new version from internet that
| > doesn't
| > | > work,
| > | > allways return automation error 80004005 and err.LstDLLError = 0!? I
| > even
| > | > tried to rewrite declaration (dissasembled code to see
| > | > what MAPI32.DLL is doing with no success).
| > | >
| > | > LAST THING WILL BE TO MAKE MY OWN SMTP CLIENT,
| > | > or another app that will be called from my original app but this is
| > far
| > | > from "simple" solution.
| > | >
| > | > I want to send some internal information & configuration from my app
| > and
| > | > display mail to user to add/modify mail before he sends it
| > | > And major thing is WITHOUT BLOCKING MY APP that will be in background
| > | > doing some work!
| > | >
| > | > If I debug project in VB and send mail, VB frozens and waits for user
| > to
| > | > close Compose window!
| > | > cause in MAPI32.dll function creates new thread for composing message
| > and
| > | > then
| > | > there is WaitForSingleObject with enough ms to wait for my life to end
| > | > 0x0FFFFFFF.
| > | >
| > | > BUT in MS documentation there is :
| > | > Header file:MAPIVB32.BAS
| > | >
| > | > MAPISendMail(Session as Long, UIParam as Long, Message as MapiMessage,
| > | > Recips as MapiRecip, Files as MapiFile, Flags as Long,
| > | > Reserved as Long) as Long - or any other MAPI function have 2
| > arguments
| > | > allways same Session & UIParam for allmost any dialog
| > | > (AddressBook, ComposeMessage, ReadMEsssage)!
| > | > UIParam - The parent window handle for the dialog box. A value of zero
| > | > indicates that any dialog box displayed is application modal.
| > | > or window modal (not app modal) if handle is any valid window handle.
| > But
| > | > there is no property for MAPIMessages control!?
| > | >
| > | > allmost to forget default MAPI client is OE that comes with w2k sp2
| > (os is
| > | > little upgraded with patches) but mapi should work with
| > | > any MAPI Client.
| > | >
| > | > I hope that there is still hope for me q;-)
| > | >
| > | > [SolarAngel]
| > | >
| > | >
| > |
| > |
| >
| >
|
|


.



Relevant Pages

  • Re: Problem with slower startup of XP windows SP3
    ... Help and Support for details. ... The Panda Anti-virus Service has started successfully. ... The Windows Security Center Service has started. ... The local computer may not have the necessary registry information or message ...
    (microsoft.public.windowsxp.general)
  • Re: Problem with slower startup of XP windows SP3
    ... Event Viewer reports renders interpretation infinitely more difficult. ... see Help and Support Center at ... "Event Viewer in windows: ... Log on as an user with administrative rights and open Internet Explorer ...
    (microsoft.public.windowsxp.general)
  • Re: SP3 potential problem
    ... Where did you download the ATI drivers from? ... Select Start, Help and Support, Keep your Windows up- to-date with Windows Update, Review your Update History you can see the update. ... I have not been able to download Net Framework ...
    (microsoft.public.windowsxp.basics)
  • Re: older games dont work
    ... the support of my work have it and will burn a CD to me. ... and any other tips to make this game works will be great. ... Windows 95 including but not limited to: ... to map a pedal as a control ...
    (microsoft.public.windowsxp.games)
  • Re: SP3 potential problem
    ... Windows Explorer and I get a message to send the info to MS. ... Remove all SP2 and later Microsoft Net Framework items and then ... Start, Help and Support, Keep your Windows up- to-date with Windows ... Event Source: Application Error ...
    (microsoft.public.windowsxp.basics)

Quantcast