Page 1 of 1

Recompiling mapi.c

Posted: Wed Feb 28, 2007 9:39 am
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?

Solved :)

Posted: Wed Feb 28, 2007 9:43 am
by AlexSchaft
Changing from CLIPPER FUNC(PARAMS) to HB_FUNC ( FUNC ) worked

Posted: Wed Feb 28, 2007 11:38 am
by Antonio Linares
Alex,

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

Posted: Wed Feb 28, 2007 3:09 pm
by James Bott
Alex,

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

James

MAPI

Posted: Wed Feb 28, 2007 7:43 pm
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

Re: MAPI

Posted: Tue May 17, 2011 1:59 pm
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

Re: Recompiling mapi.c

Posted: Tue May 17, 2011 2:20 pm
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

Re: Recompiling mapi.c

Posted: Tue May 17, 2011 2:52 pm
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

Re: Recompiling mapi.c

Posted: Tue May 17, 2011 3:49 pm
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

Re: Recompiling mapi.c

Posted: Tue May 17, 2011 5:59 pm
by Davide
Lapsus: How do I recompile a C module with xH/Bcc5.5 (FWH 9.05) ?

Tnx,
Davide

Re: Recompiling mapi.c

Posted: Wed May 18, 2011 12:17 pm
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

Re: Recompiling mapi.c

Posted: Thu Jul 05, 2012 2:11 pm
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