1. RE: Errors

Hi Vern,

That does not appear to be a valid return value for that function.  But 
then again, MAPI_USE_DEFAULT doesn't appear to be a valid value for 
flFlags.  What is the value of MAPI_USE_DEFAULT?  How did you define 
MAPILogon?

-- Brian


Vern wrote:
> Hi, I recently upgraded to WinXP Pro and am having a little trouble with 
> a
> script I wrote as an Apache cgi script.  The script call MAPI functions 
> and
> uses Outlook Express default user to relay form input ... this script 
> work
> well under Win98.  Now I get an error number -2147467259
> when the
> 
> error = c_func(MAPILogon, {0, 0, 0, MAPI_USE_DEFAULT, 0, session}) call 
> is
> made
> 
> if error then
>  printf(1,"Error sending Message %d",error)
>   abort(error)
> end if
> 
> Any ideas what this error number represents??
> 
> Thanks
> Vern
> 
>

new topic     » topic index » view message » categorize

2. RE: Errors

Found out the answer to the first question:

>From mapi.h
/*# define MAPI_USE_DEFAULT     0x00000040     Use default profile in 
logon */

but being commented pretty much deprecates it as a valid flag.

Valid flags are:
flFlags 
[in] Bitmask of option flags. The following flags can be set: 
MAPI_FORCE_DOWNLOAD
#define MAPI_FORCE_DOWNLOAD     0x00001000  
An attempt should be made to download all of the user's messages before 
returning. If the MAPI_FORCE_DOWNLOAD flag is not set, messages can be 
downloaded in the background after the function call returns.
 
MAPI_NEW_SESSION
#define MAPI_NEW_SESSION        0x00000002  
An attempt should be made to create a new session rather than acquire 
the environment's shared session. If the MAPI_NEW_SESSION flag is not 
set, MAPILogon uses an existing shared session. 

MAPI_LOGON_UI 
#define MAPI_LOGON_UI           0x00000001  
A logon dialog box should be displayed to prompt the user for logon 
information. If the user needs to provide a password and profile name to 
enable a successful logon, MAPI_LOGON_UI must be set. 

MAPI_PASSWORD_UI 
#define MAPI_PASSWORD_UI        0x00020000
MAPILogon should only prompt for a password and not allow the user to 
change the profile name. Either MAPI_PASSWORD_UI or MAPI_LOGON_UI should 
not be set, since the intent is to select between two different dialog 
boxes for logon. 

Hope this helps...
-- Brian

Brian Broker wrote:
> Hi Vern,
> 
> That does not appear to be a valid return value for that function.  But 
> then again, MAPI_USE_DEFAULT doesn't appear to be a valid value for 
> flFlags.  What is the value of MAPI_USE_DEFAULT?  How did you define 
> MAPILogon?
> 
> -- Brian
> 
> 
> Vern wrote:
> > Hi, I recently upgraded to WinXP Pro and am having a little trouble with 
> > 
> > a
> > script I wrote as an Apache cgi script.  The script call MAPI functions 
> > and
> > uses Outlook Express default user to relay form input ... this script 
> > work
> > well under Win98.  Now I get an error number -2147467259
> > when the
> > 
> > error = c_func(MAPILogon, {0, 0, 0, MAPI_USE_DEFAULT, 0, session}) call 
> > is
> > made
> > 
> > if error then
> >  printf(1,"Error sending Message %d",error)
> >   abort(error)
> > end if
> > 
> > Any ideas what this error number represents??
> > 
> > Thanks
> > Vern
> > 
> >

new topic     » goto parent     » topic index » view message » categorize

3. RE: Errors

> -----Original Message-----
> From: vern at lvp.eastlink.ca [mailto:vern at lvp.eastlink.ca]

> Hi, I recently upgraded to WinXP Pro and am having a little 
> trouble with a
> script I wrote as an Apache cgi script.  The script call MAPI 
> functions and
> uses Outlook Express default user to relay form input ... 
> this script work
> well under Win98.  Now I get an error number -2147467259
> when the
> 
> error = c_func(MAPILogon, {0, 0, 0, MAPI_USE_DEFAULT, 0, 
> session}) call is
> made
> 
> if error then
>  printf(1,"Error sending Message %d",error)
>   abort(error)
> end if

I'm not familiar with MAPI in particular, but the error number will be more
meaningful if you output in hex:

	printf(1,"Error sending Message #%08x",error)

If you have a C compiler, look for winerror.h (or something like that), and
you should be able to find the error number in hex.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

4. RE: Errors

If you don't want to use any of the options listed below, you can still 
use MAPI_USE_DEFAULT but you must use it with MAPILogonEx.  (This 
function doesn't appear to be wrapped in parser.ex so you'd have to 
define it yourself.)

Refer to 
http://msdn.microsoft.com/library/en-us/mapi/html/_mapi1book_mapilogonex.asp


-- Brian

Vern wrote:
> Hi, Brian, thank you for your timely response.  The snipet of code I 
> posted
> was just the error portion, for a complete look at the defs, refer to
> parser.ew on the contributors page as my example (I admit it is sadly
> authored but it does work).  The flags are set to not force_down_load as
> this would serious degrade the cgi process and maybe even timeout the
> webserver ... anyway, this script works excellent under win98 but not 
> under
> winXP...
> ----- Original Message -----
> From: "Brian Broker" <bkb at cnw.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Wednesday, February 06, 2002 2:42 PM
> Subject: RE: Errors
> 
> 
> > Found out the answer to the first question:
> >
> > >From mapi.h
> > /*# define MAPI_USE_DEFAULT     0x00000040     Use default profile in
> > logon */
> >
> > but being commented pretty much deprecates it as a valid flag.
> >
> > Valid flags are:
> > flFlags
> > [in] Bitmask of option flags. The following flags can be set:
> > MAPI_FORCE_DOWNLOAD
> > #define MAPI_FORCE_DOWNLOAD     0x00001000
> > An attempt should be made to download all of the user's messages before
> > returning. If the MAPI_FORCE_DOWNLOAD flag is not set, messages can be
> > downloaded in the background after the function call returns.
> >
> > MAPI_NEW_SESSION
> > #define MAPI_NEW_SESSION        0x00000002
> > An attempt should be made to create a new session rather than acquire
> > the environment's shared session. If the MAPI_NEW_SESSION flag is not
> > set, MAPILogon uses an existing shared session.
> >
> > MAPI_LOGON_UI
> > #define MAPI_LOGON_UI           0x00000001
> > A logon dialog box should be displayed to prompt the user for logon
> > information. If the user needs to provide a password and profile name to
> > enable a successful logon, MAPI_LOGON_UI must be set.
> >
> > MAPI_PASSWORD_UI
> > #define MAPI_PASSWORD_UI        0x00020000
> > MAPILogon should only prompt for a password and not allow the user to
> > change the profile name. Either MAPI_PASSWORD_UI or MAPI_LOGON_UI should
> > not be set, since the intent is to select between two different dialog
> > boxes for logon.
> >
> > Hope this helps...
> > -- Brian
> >
> > Brian Broker wrote:
> > > Hi Vern,
> > >
> > > That does not appear to be a valid return value for that function.  But
> > > then again, MAPI_USE_DEFAULT doesn't appear to be a valid value for
> > > flFlags.  What is the value of MAPI_USE_DEFAULT?  How did you define
> > > MAPILogon?
> > >
> > > -- Brian
> > >
> > >
> > > Vern wrote:
> > > > Hi, I recently upgraded to WinXP Pro and am having a little trouble
> with
> > > >
> > > > a
> > > > script I wrote as an Apache cgi script.  The script call MAPI
> functions
> > > > and
> > > > uses Outlook Express default user to relay form input ... this script
> > > > work
> > > > well under Win98.  Now I get an error number -2147467259
> > > > when the
> > > >
> > > > error = c_func(MAPILogon, {0, 0, 0, MAPI_USE_DEFAULT, 0, session})
> call
> > > > is
> > > > made
> > > >
> > > > if error then
> > > >  printf(1,"Error sending Message %d",error)
> > > >   abort(error)
> > > > end if
> > > >
> > > > Any ideas what this error number represents??
> > > >
> > > > Thanks
> > > > Vern
> > > >
> > > >
<snip>

new topic     » goto parent     » topic index » view message » categorize

5. RE: Errors

> -----Original Message-----
> From: vern at lvp.eastlink.ca [mailto:vern at lvp.eastlink.ca]

> Well, I'm just not having any fun with this problem at all
> I followed the insightfullness of David Cuny and converted my
> little error
> number into hex and compared it to the value listed in
> winerror.h supplied
> with Borland5.5 and lol and behold,  error #80004005 -
> unspecified error
> LOL

When I've gotten errors like that, I've usually traced it back to an
improperly declared structure.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

6. RE: Errors

Bernie,

Perhaps you missed my replies (or chose to ignore them) but 
MAPI_USE_DEFAULT is not a valid flag for MAPILogon.  You might consider 
using MAPILogonEx. (I don't know if this is XP only or what, I'm just 
going by the SDK docs.)

On the other hand, it just might work if you define the parameters 
correctly.  Try this:

mapi_dll = open_dll("mapi32.dll")
MAPILogon = define_c_func(mapi_dll, "MAPILogon",
        {C_ULONG, C_POINTER, C_POINTER, C_UINT, C_ULONG, C_POINTER},
        C_ULONG)

There are no signed inputs...  Same goes for MAPILogonEx, which doesn't 
look like it's any more difficult to use.

MAPILogonEx = define_c_func(mapi_dll,"MAPILogonEx",
              {C_ULONG,C_POINTER,C_POINTER,C_UINT,C_POINTER},C_UINT)

Refer to my last post for a URL with more info on this function.
-- Brian

Bernie wrote:
> I agree, but I am at a loss as to the new scructure, for this script 
> does
> work well under Win98 but not under WinXP.  I now know that it is not a
> Euphoria problem but rather a new format perhaps in mapi32.dll
> 
> here is a snipet of the decalrations
> 
> integer   MAPILogon, MAPILogoff, MAPISendMail, ok, ok1, ok2, ok3, ok4
> atom      mapi_dll, session, error, message, recipient
> 
> constant
> MAPI_TO = 1,
>       MAPI_LOGON_UI = 1,
>       MAPI_FORCE_DOWNLOAD = #1000,
>       MAPI_USE_DEFAULT = #0040,
>       RECIPCLASS = 4,
>       NAME = 8,
>       ADDRESS = 12,
>       SUBJECT = 4,
>       TEXT = 8,
>       RECIPCOUNT = 32,
>       RECIPIENTS = 36
> 
> mapi_dll = open_dll("mapi32.dll")
> MAPILogon = define_c_func(mapi_dll, "MAPILogon",
>         {C_LONG, C_POINTER, C_POINTER, C_LONG, C_LONG, C_POINTER},
>         C_LONG)
> MAPILogoff = define_c_func(mapi_dll, "MAPILogoff",
>   {C_INT, C_INT, C_INT, C_INT},
>   C_LONG)
> MAPISendMail = define_c_func(mapi_dll, "MAPISendMail",
>   {C_INT, C_INT, C_POINTER, C_INT, C_INT},
>   C_LONG)
> 
> -- then the first attempt at use ....
> 
> session = allocate(4)
> error = c_func(MAPILogon, {0, 0, 0, MAPI_USE_DEFAULT, 0, session})
> 
> if error then
>  --printf(1,"<br><br>Error sending Message %d<br><br>",error)
>  printf(1,"<br><br>Error sending Message #%08x<br><br>",error)    --
> 80004005 unspecified error
>  abort(error)
> end if
> 
> 
> At anyrate, I appreciate all of the help on this problem, perhaps it is 
> time
> I move away from windows mapi and into smpt  :)
> 
> Bernie Somes
> 
> ----- Original Message -----
> From: "Matthew Lewis" <matthewwalkerlewis at YAHOO.COM>
> To: "EUforum" <EUforum at topica.com>
> Sent: Friday, February 08, 2002 7:51 AM
> Subject: RE: Errors
> 
> 
> > > -----Original Message-----
> > > From: vern at lvp.eastlink.ca [mailto:vern at lvp.eastlink.ca]
> >
> > > Well, I'm just not having any fun with this problem at all
> > > I followed the insightfullness of David Cuny and converted my
> > > little error
> > > number into hex and compared it to the value listed in
> > > winerror.h supplied
> > > with Borland5.5 and lol and behold,  error #80004005 -
> > > unspecified error
> > > LOL
> >
> > When I've gotten errors like that, I've usually traced it back to an
> > improperly declared structure.
> >
> > Matt Lewis
> >
> >

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu