Recompiling mapi.c

Post Reply
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Recompiling mapi.c

Post by AlexSchaft »

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?
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Solved :)

Post by AlexSchaft »

Changing from CLIPPER FUNC(PARAMS) to HB_FUNC ( FUNC ) worked
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Alex,

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

James
User avatar
AlexSchaft
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

MAPI

Post by AlexSchaft »

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
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: MAPI

Post by Davide »

Hi,

it would be nice in a future FWH version that instead of:

Code: Select all

          #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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Recompiling mapi.c

Post by James Bott »

>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
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: Recompiling mapi.c

Post by Davide »

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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Recompiling mapi.c

Post by James Bott »

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
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: Recompiling mapi.c

Post by Davide »

Lapsus: How do I recompile a C module with xH/Bcc5.5 (FWH 9.05) ?

Tnx,
Davide
Davide
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: Recompiling mapi.c

Post by Davide »

I'm trying to recompile the MAPI.C from Daniel at http://forums.fivetechsupport.com/viewt ... .c#p107611 , but:

Code: Select all

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
User avatar
Eroni
Posts: 71
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: Recompiling mapi.c

Post by Eroni »

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 1709 BCC72 MySql MariaDB
Visual Studio 2019 / Xamarin / C#
Post Reply