You may be correct. I only will be having one at a time syncing, but there
may be many in the warehouse. I found that it is possible to identify which
one is in the cradle using VB, but that is not the language I'm using. There
is a tool in VB CEUtil.h that those guys can use which is exactly what I
need. Here's the code quoted from another forum:

 

Thank you for your help.
I found a method in the CEUtil.h Lib (API-Calls and constants).


' VBA-Modul in Access

Public Declare Function CeGetDeviceId Lib "ceutil" () As Long
Public Const CE_Services = "Software\Microsoft\Windows CE Services"


Private Function GetDeviceID() As String
Dim iddvc As Long
Dim dummy As String
Dim x, y

GetDeviceID = ""

iddvc = CeGetDeviceId()

Select Case iddvc
Case 0
GetDeviceID = "NO"
Case -1
GetDeviceID = "GAST"
Case Else
' Success ! Device-ID convert.
'
dummy = CStr(Hex(iddvc))
' The string must be 8 Bytes long
x = 8 - Len(dummy)
For y = 1 To x
dummy = "0" & dummy
Next y

GetDeviceID = dummy

End Select

End Function
'
' Now find the Sync-Folder on the Desktop PC for the connected Pocket PC.
' ExistKey and GetSettingString are API-Calls from the Registry Lib
' to get informations (keys) from the registry.
'
Private Function GetSyncFolder() As String
Dim ID, Partner As String
If ExistKey(HKEY_CURRENT_USER, CE_Services) Then
ID = GetDeviceID
Select Case ID
Case "NO"
MsgBox "No Pocket PC is connected."
GetSyncFolder = ""
Case "GAST"
MsgBox "You are connected as a guest. No Sync-Folder."
GetSyncFolder = ""
Case Else
Partner = CE_Services & "\Partners\" & ID & "\Services\Synchronization"
'
If ExistKey(HKEY_CURRENT_USER, Partner) Then
GetSyncFolder = GetSettingString(HKEY_CURRENT_USER, Partner,
"Briefcase Path")
MsgBox GetSyncFolder
Else
MsgBox "Registry Key is not defined. Define a partnership."
GetSyncFolder =""
End If
'
End Select
Else
MsgBox ("Registry Key is not defined. Install ActiveSync.")
End If
End Function

 

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of Thomas Gruber
Sent: Wednesday, March 10, 2010 11:29 AM
To: [email protected]
Subject: Re: [nsbasic-ce] Re: Identification of PDA

 



Hello George,

if you have more than 2 mobile devices I think you will run into a
restriction in ActiveSync anyway: it can only store profiles for 2 different
mobile devices; if you connect a 3rd device, you either have to remove one
of the others, or connect it as a "guest", in which case you can't
synchronize any files. At least that's my knowledge from the ActiveSync
versions I have used - does one of the experts in this forum know an
alternative? 

To identify the different devices you could use the user defined device name
(not the serial number) that you can set in the control panel of the device,
or simply store a mini text file in a specific folder on the device that you
can read during synchronisation. The device name is the one that ActiveSync
uses to generate the main folder name as Joe described in his message, this
can be read by NSBasic/CE from the registry.

 

I think if you want to read from multiple devices (more than 2) you have to
read directly from the device, not by using ActiveSync to copy the files
from the device to the PC, but I must admit I don't know if that's possible.
Windows Explorer can do that, so it may be, but I don't know how to access
System Folders like "Mobile Device" from NSBasic.

Kind regards

Thomas

 

Am 08.03.2010 um 22:12PM schrieb George Walters:





  

Thanks, I think I could use this. At least I can cruise the folders and
display a list to the user with a name he/she can recognize.

-----Original Message-----
From: nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com
[mailto:nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com]
On
Behalf Of joespan123
Sent: Monday, March 08, 2010 3:48 PM
To: nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com
Subject: [nsbasic-ce] Re: Identification of PDA

Hi,

Do not rely on the serial number to identify each device, as an example the
new iPAQ 212 devices return the same serial numbers.

To answer this question:

If I put that in a file on the PDA, it would get sync'ed to a folder on XP
and I don't know which folder it went to.

When the device syncs with the desktop and you have chosen "File" transfer,
all the files in the "My Documents" folder on the device will be sync'ed
over to the destop in the folder with name like:

C:\Documents and Settings\JoePC\My Documents\JOES My Documents

The "JoePC" is the login username of the desktop.

The "JOES My Documents" is the folder created by ActiveSync for the device
to perform file transfer.

The "JOES" is what you define on the device in the settings:

Start -> Settings -> About -> Device ID

The "Device ID" here must be defined unqiuely for each device you synchroise
with the desktop, hence it is the way ActiveSync knows which device is which
if you sync multiple devices.

When you sync the device, it will transfer the files over into it's unique
folder.

Your application on the desktop will not know which device has actually
sync'ed. But you maybe be able to tell by creating a Status.txt file on the
device with say a DATE/TIME in their. Your desktop application should check
periodically for the Status.txt file in every folder and check the DATE/TIME
for changes.

Or you can interact with the ActiveSync process to detect when a device has
been inserted into the cradle.

The following gives some code examples on how to use the RAPI.dll on the
desktop.

http://etutorials.
<http://etutorials.org/Programming/Pocket+pc+network+programming/Chapter+9.+
D> org/Programming/Pocket+pc+network+programming/Chapter+9.+D
esktop+Synchronization/

Cheers
Joe

--- In nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com,
"George Walters" <gwalt...@...> wrote:
>
> Thanks, I didn't know that but I don't think that would solve the problem.
> If I put that in a file on the PDA, it would get sync'ed to a folder on XP
> and I don't know which folder it went to. Each folder would have a serial
> number but I still don't know which PDA is sitting in the cradle. Follow
> what I'm trying to say?
> 
> 
> 
> _____ 
> 
> From: nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com
[mailto:nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com]
On
> Behalf Of Computerhusky
> Sent: Monday, March 08, 2010 2:35 PM
> To: nsbasic...@yahoogro <mailto:nsbasic-ce%40yahoogroups.com> ups.com
> Subject: Re: [nsbasic-ce] Identification of PDA
> 
> 
> 
> 
> 
> 
> 
> 
> Hi George,
> 
> you know that NSBasic/CE can read the serial number of the device
> I assume, and the problem is that the desktop program cannot access this
> information? What about letting the program on the device write that
number
> to a text file, then the desktop program can read that file first, then
from
> that info derive the folder name.
> 
> Kind regards
> 
> Thomas
> 
> 
> Von meinem iPhone gesendet
> 
> 
> Am 08.03.2010 um 17:37 schrieb "georgeewalters" <gwalt...@...>:
> 
> 
> 
> I'm trying to write software to handle multiple PDA's collecting and
> submitting data. I have writte the software in the XP computer and written
> the software on the PDA using NS Basic. My problem now is how do identify
> which of the more than one PDA is sitting the cradle for syncing so I can
> put/get the data in/from the correct folder. Anyone know how to do this?
> I've googled around a lot and have no results. No problem with only one
PDA
> but more that one presents this issue.
>

------------------------------------

Yahoo! Groups Links

 








-- 
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en.

Reply via email to