Page 1 of 1

bug in Mapi

PostPosted: Tue Feb 23, 2010 3:14 pm
by ukservice
Hi,

When you close the Mail client, a GPF occurs.

This is the test code:

#include "FiveWin.ch"
#include "Mail.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar
DEFINE WINDOW oWnd TITLE "Using Windows MAIL Services"

SET MESSAGE OF oWnd TO "FiveWin - Windows MAIL support" CENTERED
ACTIVATE WINDOW oWnd ON INIT Test() ;
VALID MsgYesNo( "Want to end ?" )
return nil
//----------------------------------------------------------------------------//

function Test()
local oMail
DEFINE MAIL oMail ;
SUBJECT "Testing..." ;
TEXT "This is real xBase power at your fingertips!" ;
FROM USER ;
RECEIPT
ACTIVATE MAIL oMail
MsgInfo( oMail:nRetCode )
return nil
//----------------------------------------------------------------------------//


Thanks

Re: bug in Mapi

PostPosted: Tue Feb 23, 2010 3:59 pm
by driessen
Hello Ukservice,

I tried your example but I got no problem at all. Everything is running just fine.

Re: bug in Mapi

PostPosted: Tue Feb 23, 2010 5:06 pm
by Antonio Linares
UkService,

What FWH version are you using ? Harbour or xHarbour ?

Re: bug in Mapi

PostPosted: Tue Feb 23, 2010 7:07 pm
by ukservice
Hi,

FWH August 2009 and Harbour 2.0.

GPF happens AFTER closing Mail client.

Thanks

Re: bug in Mapi

PostPosted: Tue Feb 23, 2010 7:30 pm
by toninhofwi
Hi.

Harbour have built-in MAPI, please look at this sample:

---cut---
#include "hbwin.ch"

PROCEDURE Main()

LOCAL cSubject := "Test subject"
LOCAL cBody := "Test body"
LOCAL lMailConf := .F.
LOCAL lFromUser := .T.
LOCAL aSender := { "test from", "from@test.com" }
LOCAL aDest := { { "test to", "to@test.com", WIN_MAPI_TO } }
LOCAL aFiles := { { "testmapi.prg", "testmapi" } }

? win_MAPISendMail( cSubject, ; // subject
cBody, ; // menssage
NIL, ; // type of message
DToS( Date() ) + " " + Time(), ; // send date
"", ; // conversation ID
lMailConf, ; // acknowledgment
lFromUser, ; // user intervention
aSender, ; // sender
aDest, ; // destinators
aFiles ; // attach
)

// simple format

? win_MAPISendMail( cSubject, ; // subject
cBody, ; // menssage
NIL, ; // type of message
DToS( Date() ) + " " + Time(), ; // send date
"", ; // conversation ID
lMailConf, ; // acknowledgment
lFromUser, ; // user intervention
"from@test.com", ; // sender
{ "to@test.com" }, ; // destinators
{ "testmapi.prg" } ; // attach
)

RETURN
---cut---


Regards,

Toninho.