|
-
Sep 5th, 2007, 07:43 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Active Synch issue
Here is my situation...
I am implementing a new barcode scanner system. The one I am replacing is almost 10 years old and written in MCL 1.0. The new ones run Windows CE. I have a cradle that attaches to my PC vis USB. I have written the application in VB2005. Everything seems to work, so far.
Every scanner runs the same code. Therefore, it creates a file (on the scanner) with the same name ("scannerfile").
I can't seem to tell ActiveSynch where to place the file. It wants to put it in c:\documents and settings\my name\my documents\scanner my documents\scannerfile.
I can write my VB6 app on the PC to look for the file there. However, the next scanner gets in the cradle and it sends it to c:\documents and settings\my name\my documents\scanner1 my documents\scannerfile.
This may be the wrong place to ask, but it is Mobile Development. Is there a good technical document about ActiveSynch 4.5? If I could get all the scanners to "synch" their file to the same place, life would be much better for me.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 07:54 AM
#2
Frenzied Member
Re: Active Synch issue
Hi,
so you are using activesync to transfer the files from different devices?
If so, I think it will do what you are seeing, to identify them differently, as it 'knows' they are from different devices.
You could handle it yourself using RAPI, or get your application on the PC to scan that particular folder, and remove the files when it has processed them.
RAPI would give you more control
Pete
-
Sep 5th, 2007, 08:34 AM
#3
Thread Starter
PowerPoster
Re: Active Synch issue
RAPI? Never heard of it. I guess it is Google time again.
They are different physcial devices. 9 different scanners. I set the ActiveSynch to only update the PC. I was hoping that I would be able to synch to the same directory/filename on the PC. The filename is the same, it is the directory that I can't seem to change.
If I can't find a fix for it today, I will have to write my app to scan all the pertinent directories and process the file from there.
Another issue... From what I am reading, the Windows CE can only synch to 2 PCs (I am not synching email). I need to synch to my PC for testign purposes. The other PC is used by 3 shifts. They log on differently. Therefore, they will each use a different "My Documents" directory. This makes me think I need to set up a synch for each user. However, if I do that, will I be violating the 2 PC rule?
This would be so much easier if I could just access the mobile device directly from the PC app, or have the VB2005 app on the Windows CE device be able to copy the file to the PC. It just seems that programmatically, they can't see each other.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 08:45 AM
#4
Frenzied Member
Re: Active Synch issue
Hi,
RAPI does exactly what you are trying to do.
There is an article here showing you how to transfer a file, using VB6.
www.opennetcf.org have an opensource desktop library with a RAPI implementation allowing you to use RAPI in your .Net desktop application.
There is a VB6 sample in MSDN here
Alternately, FTP the file from the PPC to the PC.
Pete
-
Sep 5th, 2007, 08:52 AM
#5
Thread Starter
PowerPoster
Re: Active Synch issue
RAPI sounds like it, from what I have been able to find. Now I need to find a sample of VB2005 using it to access a Windows CE5.0 device.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 09:05 AM
#6
Frenzied Member
Re: Active Synch issue
Hi,
try http://www.opennetcf.org/permalink2....f-70dc239443c2
You can always use one of the translators to translate the C# to VB
Pete
-
Sep 5th, 2007, 10:13 AM
#7
Thread Starter
PowerPoster
Re: Active Synch issue
I did find a sample at
http://www.devbuzz.com/content/zinc_...ice_II_pg1.asp
I am trying to 'massage' it so it will work in my environment. I am having a few issues, but I am making progress.
I plan on leaving this thread unresloved until I can have my VB6 app on my PC actually download the file from the scanner. Hopefully by the end of the day.
Thanks for all your help so far.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:21 AM
#8
Frenzied Member
Re: Active Synch issue
Hi,
if you are using VB6 on the desktop, take a look at http://www.unsupportedsoftware.com/p...dev/vbrapi.htm
Pete
-
Sep 5th, 2007, 10:23 AM
#9
Thread Starter
PowerPoster
Re: Active Synch issue
I am at the point where it wantrs to create a binary file. The original code says:
Open Form1.txtDesktopFile.Text For Binary As intFreeFileID
For intWriteLoop = 0 To lngBytesRead
Put #intFreeFileID, intWriteLoop + 1, bytBuffer(intWriteLoop)
Next intWriteLoop
I don't have a form1.textbox, so I used the scanner filename
Open "My documents\scannerfile" For Binary As intFreeFileID
For intWriteLoop = 0 To lngBytesRead
Put #intFreeFileID, intWriteLoop + 1, bytBuffer(intWriteLoop)
Next intWriteLoop
I get an error 183 as soon as it tries to execute the "Open..." statement.
183 seems to be a generic error. Any ideas?
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:28 AM
#10
Frenzied Member
Re: Active Synch issue
Hi,
"\My documents\scannerfile" ?? - note the 'leading slash'
Pete
-
Sep 5th, 2007, 10:29 AM
#11
Thread Starter
PowerPoster
Re: Active Synch issue
I noticed that the file on the scanner was empty. So, I scanned a record and put it back on the cradle. It synched. Not it can't find the file.
here is the code:
Dim filename As String
filename = "My Documents\ScannerFile"
Dim intRetVal As Integer
intRetVal = CeRapiInit()
If intRetVal <> INIT_SUCCESS Then
MsgBox "Failed to initialise RAPI with device with error " & _
CeGetLastError
CeRapiUninit
Exit Function
End If
'locate the file, and see if it already exists on the device
lngFileHandle = CeFindFirstFile(filename, typFindFileData)
If lngFileHandle = INVALID_HANDLE Then
MsgBox "File " & filename & " Not Found. Operation Aborted.", vbOKOnly
CopyFileFromPocketPC = False
Exit Function
End If
I'm not sure what this is all about.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:31 AM
#12
Thread Starter
PowerPoster
Re: Active Synch issue
The code from the sample:
'locate the file, and see if it already exists on the device
lngFileHandle = CeFindFirstFile(Form1.txtPPCFile.Text, typFindFileData)
If lngFileHandle = INVALID_HANDLE Then
MsgBox "File " & Form1.txtPPCFile.Text & " Not Found. Operation Aborted.", vbOKOnly
CopyFileFromPocketPC = False
Exit Function
End If
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:32 AM
#13
Frenzied Member
Re: Active Synch issue
Are you still using activesync and RAPI - you need to turn off activesync for that file if that is the case
-
Sep 5th, 2007, 10:37 AM
#14
Thread Starter
PowerPoster
Re: Active Synch issue
I tried "My Device\My Documents\ScannerFile"... Still file not found.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:39 AM
#15
Thread Starter
PowerPoster
Re: Active Synch issue
How do you turn off ActiveSynch? I unchecked the file synch check box
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:41 AM
#16
Frenzied Member
Re: Active Synch issue
Hi,
"\My Documents\Scannerfile" if "scannerfile" is the full name of your file.
The sample I pointed you at in the textbox has "\my documents\test.txt" or similar as the device file
-
Sep 5th, 2007, 10:45 AM
#17
Thread Starter
PowerPoster
Re: Active Synch issue
I killed ActiveSynch and changed the file name back. I still get the file not found error. However, the scanner beeps now when I try to access it.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:47 AM
#18
Thread Starter
PowerPoster
Re: Active Synch issue
It quite beeping when I try to access it now. Very strange.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:49 AM
#19
Thread Starter
PowerPoster
Re: Active Synch issue
I don't see any mention of the version of Windows CE that this is for. I am using CE 5.0. Could that be an issue?
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 10:53 AM
#20
Frenzied Member
Re: Active Synch issue
Hi,
RAPI? Should work with any version.
I would quickly create a mickey mouse test file on the device, and try copying that up, and start from there. Or if you have VB6, try the sample from devbuzz - that is how I started using RAPI
Pete
-
Sep 5th, 2007, 11:01 AM
#21
Thread Starter
PowerPoster
Re: Active Synch issue
I have a file on the device. I can copy it using Windows Explorer. I copied the sample and just modified the file name so that it is "hard coded" and not coming from a text box. I woudl think it should work. I will keep trying different things.
So, when I move this off my development PC and put it in to operation on a production PC, I don't want to install ActiveSynch. Is that correct?
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 11:56 AM
#22
Frenzied Member
Re: Active Synch issue
Hi,
I think you are ok with the RAPI library - I think 
Pete
-
Sep 5th, 2007, 12:20 PM
#23
Thread Starter
PowerPoster
Re: Active Synch issue
I tried the Microsoft MSDN version. However, it requires ActiveSynch.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 01:25 PM
#24
Thread Starter
PowerPoster
Re: Active Synch issue
ActiveSynch started really having issues. I rebooted the PC and now the file transfer program works. Weird.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 5th, 2007, 01:35 PM
#25
Thread Starter
PowerPoster
Re: Active Synch issue
Interesting. I downloaded the necessary RAPI library and used the sample code, which is now working. It requires ActiveSynch to be running, but the synch part turned off. I can live with that I guess.
The documentation says (about the RAPI library)
"This file is purely to assist developers, it does not need to be distributed with your projects."
However, when I compile it and copy the exe to a shared directory, the users get an error that they need to register RAPI.DLL
Am I missing something here?
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Sep 6th, 2007, 11:02 AM
#26
Thread Starter
PowerPoster
Re: [RESOLVED] Active Synch issue
I will just install RAPI.DLL on each and every PC and be done with it.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|