FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)
Posted: Mon Jun 07, 2010 02:26 PM
Hi,

after an update from FWH 8.10 to 10.05 and to the actual xHarbour + BCC 5.82 I get following errors during compiling:
Error E2238 \xharbour\include\clipdefs.h 86: Multiple declaration for 'WORD'
Error E2344 \bcc582\include\windef.h 155: Earlier declaration of 'WORD'
Error E2238 \xharbour\include\clipdefs.h 88: Multiple declaration for 'PWORD'
Error E2344 \bcc582\include\windef.h 164: Earlier declaration of 'PWORD'
*** 4 errors in Compile ***


Has anyone a hint, how to handle this problem?

Thanks in advance :-)
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82
Posted: Mon Jun 07, 2010 02:44 PM

Gilbert,

What file are you trying to compile ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82
Posted: Tue Jun 08, 2010 09:08 AM
Antonio,

it's a modified printdc.c, which we use now for several years, this is the code. As I didn't write it myself, I'd appreciate your help :-)

Code (fw): Select all Collapse
#include <WinTen.h>
#include <Windows.h>
//#include <Print.h>
#include <CommDlg.h>
#include <hbapi.h>
#include <HBDEFS.h>
#include <CLIPAPI.h>


static far PRINTDLG pd;


HB_FUNC(PRNSETUP) // ( hWndOwner ) --> cPrinterName, cPrinterDriver, cPortName, hDC
{   LPDEVNAMES lpDevNames;
    LPDEVMODE  lpDevMode;
    BOOL lOK;

    _bset( ( BYTE * ) &pd, 0, sizeof( PRINTDLG ) );

    if (hb_parinfo(0) == 0)
    pd.hwndOwner = GetActiveWindow();
    else
    pd.hwndOwner = (HWND) hb_parnl( 1 );

//IF( hb_parinfo(0) == (hwnd)0, GetActiveWindow(), hb_parni( 1 ) ); // hWndOwner

    pd.lStructSize = sizeof( PRINTDLG );
    pd.hDevMode    = NULL;
    pd.hDevNames   = NULL;
    pd.Flags       = PD_PRINTSETUP | PD_RETURNDC;

    lOK = PrintDlg( &pd );

    if (lOK != 0)
        {
            lpDevNames = (LPDEVNAMES) GlobalLock( pd.hDevNames );
            lpDevMode  = (LPDEVMODE) GlobalLock( pd.hDevMode );

            hb_reta( 4 );       // return 4 elements
            hb_storc( ( LPSTR ) lpDevNames + lpDevNames->wDeviceOffset, -1, 1 );    // first element is printer name
            hb_storc( ( LPSTR ) lpDevNames + lpDevNames->wDriverOffset, -1, 2 );    // second element is printer driver
            hb_storc( ( LPSTR ) lpDevNames + lpDevNames->wOutputOffset, -1, 3 );    // third element is printer port
            hb_storni( (int)pd.hDC, -1, 4 );//jjjjjj                                                     // fourth element is printer hDC

            GlobalUnlock( pd.hDevNames );
            GlobalUnlock( pd.hDevNames );
        }
    else
        {
            hb_reta( 4 );       // return 4 elements
            hb_storc( "", -1, 1 );      // first element is printer name
            hb_storc( "", -1, 2 );      // second element is printer driver
            hb_storc( "", -1, 3 );      // third element is printer port
            hb_storni( 0, -1, 4 );      // fourth element is printer hDC
        }
}
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82
Posted: Thu Jun 10, 2010 01:12 PM

Antonio (and others):

now I tried to use the original printdc.c (as I don't include my own printdc.c anymore) and a strange thing happens:
nothing happens, when I call Printsetup(). Usually a printer setup dialog should open, but the program rusn on as I hadn't called this function.

Has anyone an idea why printsetup() doesn't react at all?

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82
Posted: Thu Jun 10, 2010 07:02 PM

It is PrinterSetup() not PrintSetup().

EMG

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82
Posted: Mon Jun 14, 2010 01:44 PM
Enrico Maria Giordano wrote:It is PrinterSetup() not PrintSetup().

EMG


But it was PrnSetup in our own printdc.c. It worked until now. But for better compatibility I now made an own function in my PRG's and am able to use the standard printdc.c now. So the matter is resolved. Thanks for your efforts
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82
Posted: Mon Jun 14, 2010 02:55 PM
Enrico Maria Giordano wrote:It is PrinterSetup() not PrintSetup().


gkuhnert wrote:But it was PrnSetup in our own printdc.c.


You are confusing PrinterSetup(), PrintSetup() and PrnSetup(). :-)

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)
Posted: Tue Jun 15, 2010 08:29 AM

Gilbert,

Is this issue solved ? Everything fine ? :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)
Posted: Tue Jun 15, 2010 12:55 PM

Antonio,

yes, many years ago we made some modifications to printdc.c and since then we used our own one. Now I reprogrammed some of my sourcecode to become fully compatible to the standard printdc.c and with these modifications I could abandon the old printdc and I don't get any errors anymore.

So everything is fine 8)

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de

Continue the discussion