Converting POS application to xHarbour + FWH

xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

I made changes to the code as shown but there is a new error that showed up.

error e2340: Type mismatch in parameter 1 (wanted 'short', got "HWND_*) in function CREATEWINE


Thanks,

Jose


CLIPPER CREATEWINE() // ( nExtendedStyle, cClassName, cTitle, nStyle, nLeft, nTop, nWidth,
// nHeight, hWndOwner, hMenu, cExtraData ) --> hWnd
{
_retni( CreateWindowEx(_parnl( 1 ), // Extended style
_parc( 2 ), // Class
_parc( 3 ), // Title
_parnl( 4 ), // Style
_parni( 5 ), // Left
_parni( 6 ), // Top
_parni( 7 ), // Width
_parni( 8 ), // Height
(HWND)_parni( 9 ), // Parent
(HMENU)_parni( 10 ), // Menu
(HINSTANCE)__hInstance,
( PCOUNT() > 10 ) ? ( void FAR * ) _parc( 11 ): 0 ) ); // Address Window-Creation-Data
}
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

Change this line this way:

_retni( ( LONG ) CreateWindowEx(_parnl( 1 ), // Extended style
...
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

Thanks for the tip. I have already the main window.

You mentioned about the fwcopy16.prg. This means I cannot use the exisiting C function WMCopyData ?

There is only one error in this function (error E2349 Nonportable pointer conversion in this line:
cds.lpData =(long)_parc(3);

I tried to remove the conversion (long) it compiles but the main screen is still not responding.


Kindly comment. Thanks.


Regards,

Jose
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

> This means I cannot use the exisiting C function WMCopyData ?

No, I didnt mean that. I dont know for sure what your application does. Are you providing some data to another application ?

>
There is only one error in this function (error E2349 Nonportable pointer conversion in this line:
>

cds.lpData = ( void * ) _parc(3);
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

Thanks, the compiler error go away.

>> Are you providing some data to another application?

Yes it is.

Is it okay to continue using the C function WMCopyData ?

Regards,

Jose
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

> Is it okay to continue using the C function WMCopyData ?

If it works fine, yes :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

The main window is showing but not responding and the menu is not showing up. I commented a try() function and get the following runtime error at oRect:Move(Max(oRect:nTop, ::nTop ).

alert('oRect:nTop='+ valtype(::nTop) ) &&<-- this is equal to 'U'.

oRect:Move( max( oRect:nTop, ::nTop ), max( oRect:nLeft, ::nLeft ) )

Here's the error log:

Application
===========
Path and name: C:\pcrwin\PCREGW32.Exe (32 bits)
Size: 2,769,408 bytes
Time from start: 0 hours 0 mins 13 secs
Error occurred at: 05/12/08, 10:10:16
Error description: Error BASE/1093 Argument error: MAX
Args:
[ 1] = N 0
[ 2] = U

Stack Calls
===========
Called from: => MAX(0)
Called from: CRect.prg => CRECT:NEW(83)
Called from: CPcreg.prg => CPCREG:NEW(63)
Called from: PCREGW.PRG => WINMAIN(87)

May be this is related to the creation of main window in C.

Any idea?

Thanks,

Jose :D
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

Please replace ::nTop with WndTop( ::hWnd )
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

There is still an error. Message not found. Here's the error log.

Thanks,

Jose

Application
===========
Path and name: C:\pcrwin\PCREGW32.Exe (32 bits)
Size: 2,769,408 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 05/12/08, 11:11:35
Error description: Error BASE/1004 Message not found: CRECT:HWND

Stack Calls
===========
Called from: tobject.prg => CRECT:ERROR(172)
Called from: tobject.prg => CRECT:MSGNOTFOUND(205)
Called from: tobject.prg => CRECT:HWND(0)
Called from: CRect.prg => CRECT:NEW(83)
Called from: CPcreg.prg => CPCREG:NEW(63)
Called from: PCREGW.PRG => WINMAIN(87)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

If you keep the handle of the window somewhere, use it here:

WndTop( hWnd ) // notice we don't use ::

If you provide us a small and self contained PRG then we may be able to provide you a better tech support :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

I just send it to your private email.

Thank you for your support.

Regards,

Jose :D
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

We have not received it yet
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

I send it again to alinares@fivetechsoft.com.

Regards,

Jose
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jose,

Remove this line from pcregw.prg:

oMportal:destroy()
regards, saludos

Antonio Linares
www.fivetechsoft.com
xhbcoder
Posts: 100
Joined: Wed Oct 04, 2006 4:50 pm
Location: USA

Post by xhbcoder »

Antonio,

I commented that line but the same error showed up.

Thanks,

Jose
Post Reply