Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)

Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)

Postby gkuhnert » Mon Jun 07, 2010 2: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 :D
Last edited by gkuhnert on Mon Jun 14, 2010 1:44 pm, edited 1 time in total.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82

Postby Antonio Linares » Mon Jun 07, 2010 2:44 pm

Gilbert,

What file are you trying to compile ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82

Postby gkuhnert » Tue Jun 08, 2010 9: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 :roll:

Code: Select all  Expand view
#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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82

Postby gkuhnert » Thu Jun 10, 2010 1: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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82

Postby gkuhnert » Mon Jun 14, 2010 1: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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Multiple Declaration of 'WORD' using FWH1005 and BCC 5.82

Postby Enrico Maria Giordano » Mon Jun 14, 2010 2: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)

Postby Antonio Linares » Tue Jun 15, 2010 8:29 am

Gilbert,

Is this issue solved ? Everything fine ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Multiple Declaration of 'WORD' in FWH1005+BCC5.82 (resolved)

Postby gkuhnert » 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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 100 guests