FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Recompiling mapi.c
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Recompiling mapi.c
Posted: Wed Feb 28, 2007 09:39 AM

Hi,

I'm trying to recompile mapi.c to use the extensions from Michael Kocum using xHarbour builder (#define KOCUM), but can't seem to get it to compile, do to function definition clashes

xcc.exe -Fo"xobj\mapi.obj" -D HARBOUR -D FLAT -I"\devmast" -I"\dev\alex" -I"\fwh\include" -I"d:\xHB\include" -I"d:\xHB\c_include" -I"d:\xHB\c_include\win" -I"d:\xHB\c_include\msvc" "d:\fwall\source\modapi\mapi.c"

d:\fwall\source\modapi\mapi.c(261): error: Redeclaration of 'MAPISENDMAIL' previously declared at d:\xHB\c_include\win\Mapi.h(141): found 'void __cdecl function (void)' expected 'unsigned long __stdcall function(unsigned long, unsigned long, MapiMessage , unsigned long, unsigned long)'.
d:\fwall\source\modapi\mapi.c(369): error: Redeclaration of 'MAPIRESOLVENAME' previously declared at d:\xHB\c_include\win\Mapi.h(159): found 'void __cdecl function (void)' expected 'unsigned long __stdcall function(unsigned long, unsigned long, char
, unsigned long, unsigned long, MapiRecipDesc * )'.
d:\fwall\source\modapi\mapi.c(415): error: Redeclaration of 'MAPIADDRESS' previously declared at d:\xHB\c_include\win\Mapi.h(155): found 'void __cdecl function(void)' expected 'unsigned long __stdcall function(unsigned long, unsigned long,char
, unsigned long, char , unsigned long, MapiRecipDesc , unsigned long, unsigned long, unsigned long , MapiRecipDesc * )'.
d:\fwall\source\modapi\mapi.c(543): error: Redeclaration of 'MAPIFINDNEXT' previously declared at d:\xHB\c_include\win\Mapi.h(145): found 'void __cdecl function(void)' expected 'unsigned long __stdcall function(unsigned long, unsigned long, char , char , unsigned long, unsigned long, char )'.
d:\fwall\source\modapi\mapi.c(590): error: Redeclaration of 'MAPIREADMAIL' previously declared at d:\xHB\c_include\win\Mapi.h(147): found 'void __cdecl function(void)' expected 'unsigned long __stdcall function(unsigned long, unsigned long, char
, unsigned long, unsigned long, MapiMessage * )'.
d:\fwall\source\modapi\mapi.c(814): error: Redeclaration of 'MAPIDELETEMAIL' previously declared at d:\xHB\c_include\win\Mapi.h(151): found 'void __cdecl function(void)' expected 'unsigned long __stdcall function(unsigned long, unsigned long, char
, unsigned long, unsigned long)'.
d:\fwall\source\modapi\mapi.c(853): error: Redeclaration of 'MAPISENDDOCUMENTS' previously declared at d:\xHB\c_include\win\Mapi.h(143): found 'void __cdecl function(void)' expected 'unsigned long __stdcall function(unsigned long, char , char , char *, unsigned long)'.

Any ideas on how to solve this?

Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
Solved :)
Posted: Wed Feb 28, 2007 09:43 AM

Changing from CLIPPER FUNC(PARAMS) to HB_FUNC ( FUNC ) worked

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Recompiling mapi.c
Posted: Wed Feb 28, 2007 11:38 AM

Alex,

FWH provides tools\Clp2Harb.exe that automatically translates the FWH C modules to Harbour required C format

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Recompiling mapi.c
Posted: Wed Feb 28, 2007 03:09 PM

Alex,

Can you tell us more about what those enhancements are, or give us a link to more information?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 172
Joined: Fri Oct 07, 2005 01:29 PM
MAPI
Posted: Wed Feb 28, 2007 07:43 PM

Hi,

It's nothing major. The default behaviour of the list of recipients for MapiSendMail, is to use the first one as the to address, and the rest as cc recipients.

If you recompile mapi.c with KOCUM defined, each recipient array gets a third element specifying type (to, cc or bcc)

Alex

Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Re: MAPI
Posted: Tue May 17, 2011 01:59 PM
Hi,

it would be nice in a future FWH version that instead of:
Code (fw): Select all Collapse
          #ifdef KOCUM
            target[ w ].ulRecipClass = _parnl( -1, 3 ) ;
         #else
            target[ w ].ulRecipClass = IF( w == 0, MAPI_TO, MAPI_CC ); // _parnl( -1, 3 ) ;
         #endif

it would automatically check if there's a third element in the array, and acting accordingly.

Hi,
Davide
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Recompiling mapi.c
Posted: Tue May 17, 2011 02:20 PM

>If you recompile mapi.c with KOCUM defined, each recipient array gets a third element specifying type (to, cc or bcc)

I think most of us would prefer this behavior.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Re: Recompiling mapi.c
Posted: Tue May 17, 2011 02:52 PM

James,

I meant leaving the default behaviour if the array has only 2 elements (for backward compatibility) and adding the specific type only if there's the third element in the array.

Hi,
Davide

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Recompiling mapi.c
Posted: Tue May 17, 2011 03:49 PM

Davide,

Sorry, I wasn't clear. I was just adding another vote for your comment. I think we all want to be able to specify CCs and BCCs.

It seems to be a very simple change so I think it is worth doing, and yes, we need backward compatibility.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Re: Recompiling mapi.c
Posted: Wed May 18, 2011 12:17 PM
I'm trying to recompile the MAPI.C from Daniel at viewtopic.php?f=6&t=19428&p=107611&hilit=mapi.c#p107611 , but:

Code (fw): Select all Collapse
Compiling...
Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
mapi.c:
Warning W8017 \xharbour\include\hbapi.h 206: Redefinition of 'ISCHAR' is not identical
Warning W8017 \xharbour\include\hbapi.h 207: Redefinition of 'ISNUM' is not identical
Warning W8017 \xharbour\include\hbapi.h 209: Redefinition of 'ISDATE' is not identical
Warning W8017 \xharbour\include\hbapi.h 212: Redefinition of 'ISBYREF' is not identical
Warning W8017 \xharbour\include\hbapi.h 213: Redefinition of 'ISARRAY' is not identical
Warning W8017 \xharbour\include\hbapi.h 215: Redefinition of 'ISBLOCK' is not identical
Warning W8075 mapi.c 249: Suspicious pointer conversion in function HB_FUN_MAPISENDMAIL
Warning W8065 mapi.c 251: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPISENDMAIL
Warning W8065 mapi.c 252: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPISENDMAIL
Warning W8075 mapi.c 257: Suspicious pointer conversion in function HB_FUN_MAPISENDMAIL
Warning W8060 mapi.c 256: Possibly incorrect assignment in function HB_FUN_MAPISENDMAIL
Warning W8065 mapi.c 266: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPISENDMAIL
Warning W8065 mapi.c 267: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPISENDMAIL
Warning W8075 mapi.c 280: Suspicious pointer conversion in function HB_FUN_MAPISENDMAIL
Warning W8060 mapi.c 279: Possibly incorrect assignment in function HB_FUN_MAPISENDMAIL
Warning W8065 mapi.c 290: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPISENDMAIL
Warning W8065 mapi.c 291: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPISENDMAIL
Error E2451 mapi.c 389: Undefined symbol 'ITEM' in function HB_FUN_MAPIADDRESS
Error E2379 mapi.c 389: Statement missing ; in function HB_FUN_MAPIADDRESS
Error E2140 mapi.c 390: Declaration is not allowed here in function HB_FUN_MAPIADDRESS
Error E2140 mapi.c 391: Declaration is not allowed here in function HB_FUN_MAPIADDRESS
Error E2140 mapi.c 392: Declaration is not allowed here in function HB_FUN_MAPIADDRESS
Warning W8075 mapi.c 398: Suspicious pointer conversion in function HB_FUN_MAPIADDRESS
Warning W8075 mapi.c 401: Suspicious pointer conversion in function HB_FUN_MAPIADDRESS
Warning W8065 mapi.c 410: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPIADDRESS
Warning W8065 mapi.c 411: Call to function 'hb_parvc' with no prototype in function HB_FUN_MAPIADDRESS
Error E2451 mapi.c 446: Undefined symbol 'aRet' in function HB_FUN_MAPIADDRESS
Error E2451 mapi.c 451: Undefined symbol 'aTemp' in function HB_FUN_MAPIADDRESS
Error E2451 mapi.c 453: Undefined symbol 'cTemp' in function HB_FUN_MAPIADDRESS
Error E2451 mapi.c 471: Undefined symbol 'nTemp' in function HB_FUN_MAPIADDRESS
Error E2451 mapi.c 558: Undefined symbol 'ITEM' in function HB_FUN_MAPIREADMAIL
Error E2379 mapi.c 558: Statement missing ; in function HB_FUN_MAPIREADMAIL
Error E2140 mapi.c 559: Declaration is not allowed here in function HB_FUN_MAPIREADMAIL
Error E2140 mapi.c 560: Declaration is not allowed here in function HB_FUN_MAPIREADMAIL
Error E2140 mapi.c 561: Declaration is not allowed here in function HB_FUN_MAPIREADMAIL
Error E2451 mapi.c 593: Undefined symbol 'aRet' in function HB_FUN_MAPIREADMAIL
Error E2451 mapi.c 597: Undefined symbol 'cTemp' in function HB_FUN_MAPIREADMAIL
Error E2451 mapi.c 639: Undefined symbol 'nTemp' in function HB_FUN_MAPIREADMAIL
Error E2451 mapi.c 647: Undefined symbol 'aAdr' in function HB_FUN_MAPIREADMAIL
Error E2451 mapi.c 652: Undefined symbol 'aTemp' in function HB_FUN_MAPIREADMAIL
*** 19 errors in Compile ***

What I'm doing wrong ?

Tnx,
Davide

FWH905, xH 1.2.1, Bcc 5.5
Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: Recompiling mapi.c
Posted: Thu Jul 05, 2012 02:11 PM

Hello everyone, someone already managed to solve this problem?
I'm trying to use the class TMail to send emails to multiple recipients, but with hidden copy (bcc), already exists the possibility to do this using the class TMail?
Regards

FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#

Continue the discussion