![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I am fiddling with RAPI, look at this code:
Sub GlobalsI allways get the disconnect event, but never the connect event. What's wrong?
__________________
iPAQ 6515, MDA compact |
|
|||
|
Agraham, thank you. I agree with you that the connect event ist only fired when you are trying to connect with the rapi.connect method.
But now I am totally confused ... I try to connect periodically by a timer event ... now I get a connect event even when the device is physically disconnected Please have a look at my attached example.I am creating a file sync program, but this connect event is driving me nuts. ![]()
__________________
iPAQ 6515, MDA compact |
|
||||
|
I get the same effect when running your code from the IDE but I think that you are calling Rapi.connect too often. Slow the timer down to 5 seconds and the behaviour changes. However I think that repeated calls of Rapi.Connect are dangerous as I have crashed both the IDE and a separately compiled exe of your code by disconnecting and reconnecting the device.
It seems that it is best to treat Rapi.Connect as a "one-off deal". You only call it once per "run" of an application and it either connects or doesn't. If you start the application without the device connected Rapi.Connect will not connect after the device is connected. If you start the application with the device connected then Rapi.Connect will give a connect event and a disconnect event when the device is disconnected. Further (not too frequent!) calls to Rapi.Connect don't reconnect and can cause a hang if the device is reconnected. A further consideration is that under the IDE it is the IDE that is seen to have issued the Rapi.Connect call so once a program under development has connected you have to exit the IDE and restart to connect again. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ActiveSync and Rapi | Lasse | Questions & Help Needed | 1 | 09-19-2007 01:25 PM |
| more events | Sven Kommers | Basic4ppc Wishlist | 3 | 06-08-2007 09:53 AM |
| RAPI library | leo | Questions & Help Needed | 3 | 05-23-2007 06:04 PM |
| Image Mouse events | LineCutter | Basic4ppc Wishlist | 1 | 05-19-2007 10:24 AM |