Hi,
In our 16bit app we used to use a function that returned a numeric handle
when we initiated a serial port - we now use init_port (xHarbour function) that returns a pointer value of the handle rather than a numeric value. We need a numeric handle for the port to use the fivewin function EnableCommNotification().
Is there any way to get the numeric handle from the pointer value?
I know this is probably a xHarbour question, I have posted this in the xHarbour forum, but havent recieved a response yet and wondered if anyone else has had a similar problem.
Thanks in advance
Pete
Serial Communications
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
Pete,
Please try this function, where x is your "pointer" value:
Please try this function, where x is your "pointer" value:
Code: Select all | Expand
MsgInfo( PointerValue( x ) )
...
#pragma BEGINDUMP
#include <hbapi.h>
HB_FUNC( POINTERVALUE )
{
hb_retnl( ( long ) hb_parptr( 1 ) );
}
#pragma ENDDUMP
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Thanks Antonio,
I have tested this on my machine and it now returns a numeric handle - i havent got a device attached to my pc at the moment and wont be able to test this fully untill i get to my clients site - i did notice that the value returned is a high number when i was expecting a 0 as no device was present - is this correct?
Pete
I have tested this on my machine and it now returns a numeric handle - i havent got a device attached to my pc at the moment and wont be able to test this fully untill i get to my clients site - i did notice that the value returned is a high number when i was expecting a 0 as no device was present - is this correct?
Pete
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Thanks for the response Antonio,
I'm at my clients site next week, so i might be able to do some tests then. Is there any examples of sending and reading of strings sent to/from a serial device using FWH functions available? I'm also currently using FWH v7.12 so are there any enhancements/fixes to any of the serial routines since then i should be aware of?
Pete
I'm at my clients site next week, so i might be able to do some tests then. Is there any examples of sending and reading of strings sent to/from a serial device using FWH functions available? I'm also currently using FWH v7.12 so are there any enhancements/fixes to any of the serial routines since then i should be aware of?
Pete
- Antonio Linares
- Site Admin
- Posts: 42529
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 31 times
- Been thanked: 77 times
- Contact:
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England
Antonio,
I'm currently at a customers site and doing some tests using fivewin functions, however whenever i try to use the function escapecomm to set rts i get an unresolved external when i compile - i'm currently using FWH 7.12 and can't upgrade at the moment untill i get back in the office - is there a way of linking this function in or an alternative way of setting rts?
Thanks
Pete
I'm currently at a customers site and doing some tests using fivewin functions, however whenever i try to use the function escapecomm to set rts i get an unresolved external when i compile - i'm currently using FWH 7.12 and can't upgrade at the moment untill i get back in the office - is there a way of linking this function in or an alternative way of setting rts?
Thanks
Pete
-
- Posts: 363
- Joined: Wed Feb 15, 2006 2:06 pm
- Location: Oxford, England