<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>OpenNETCF Desktop Communication Library</title><link>http://rapi.codeplex.com/project/feeds/rss</link><description>A managed code library wrapper around the Remote Application Programmer&amp;#39;s Interface &amp;#40;RAPI&amp;#41; exposed by ActiveSync and Windows Mobile Device Center &amp;#40;WMDC&amp;#41;.</description><item><title>New Post: OpenNETCF Desktop Communication Error</title><link>http://rapi.codeplex.com/discussions/341498</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Ignore this please. I shut down Visual Studio and restarted and now it works. A gremlin in the system has been exorcised.&lt;/p&gt;&lt;/div&gt;</description><author>MadApe</author><pubDate>Wed, 22 Feb 2012 18:48:34 GMT</pubDate><guid isPermaLink="false">New Post: OpenNETCF Desktop Communication Error 20120222064834P</guid></item><item><title>New Post: OpenNETCF Desktop Communication Error</title><link>http://rapi.codeplex.com/discussions/341498</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I&amp;nbsp; tried reusing old code that worked in the past. I connect to the device and I transfer to the PC. Works well on first pass. However if the user wants to re-transfer the file he is getting an error if the file resides on the PC from a previous transfer.&lt;/p&gt;
&lt;p&gt;Here is the code that I use to copy the file:&lt;/p&gt;
&lt;p&gt;MyRapi.CopyFileFromDevice(strPCCopyDestination, strDevCopySource, True)&lt;/p&gt;
&lt;p&gt;This works on first transfer. Doesn't after that.&lt;/p&gt;
&lt;p&gt;The error reported is:&lt;/p&gt;
&lt;p&gt;OverFlow Exception was unhandled.&lt;/p&gt;
&lt;p&gt;Arithmetic operation resulted in an overflow.&lt;/p&gt;
&lt;p&gt;Thinking that my OpenNetCF was out of date I checked and it was, so I downloaded the Jan 2012 version and built my own OpenNETCF Desktop Communication DLL. The end result is I am still getting the same overflow error.&lt;/p&gt;
&lt;p&gt;I thought that the boolean part of the copy, when set True, would overwrite any copy on the destination folder.&lt;/p&gt;
&lt;p&gt;What is going on? Do I have to write a separate utility outside of OpenNETCF to handle duplicate files now?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;MadApe&lt;/p&gt;&lt;/div&gt;</description><author>MadApe</author><pubDate>Wed, 22 Feb 2012 16:55:56 GMT</pubDate><guid isPermaLink="false">New Post: OpenNETCF Desktop Communication Error 20120222045556P</guid></item><item><title>Created Issue: 64-bit compliance [9148]</title><link>http://rapi.codeplex.com/workitem/9148</link><description>Related issues&amp;#58; 7906&amp;#59; 8497.&lt;br /&gt;&lt;br /&gt;My solution&amp;#58;&lt;br /&gt;private const short INVALID_HANDLE_VALUE &amp;#61; -1&amp;#59;&lt;br /&gt;-&amp;#62;&lt;br /&gt;private static IntPtr INVALID_HANDLE_VALUE &amp;#61; &amp;#40;IntPtr&amp;#41;&amp;#40;-1&amp;#41;&amp;#59;  &amp;#47;&amp;#47; compiler does not allow making this const &amp;#58;&amp;#40;&lt;br /&gt;&lt;br /&gt;Plus you have to remove all IntPtr-&amp;#62;int casts &amp;#40;compiler shall show these&amp;#41;.&lt;br /&gt;</description><author>AHDPOH</author><pubDate>Wed, 01 Feb 2012 20:46:32 GMT</pubDate><guid isPermaLink="false">Created Issue: 64-bit compliance [9148] 20120201084632P</guid></item><item><title>New Post: how to copy folder from windows ce device using openNETCF desktop communication library</title><link>http://rapi.codeplex.com/discussions/284018</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;hi pradeep,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;try using the below code to check if folder exists in the device:&lt;/p&gt;
&lt;p&gt;string strPath_Mobile = @"\pipes_mobile\";&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;/span&gt;MessageBox.Show("Folder '"+strPath_Mobile+ "' exists? Result = " + rapi.DeviceFileExists(strPath_Mobile + ".").ToString());&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;&lt;/div&gt;</description><author>avtividad</author><pubDate>Wed, 18 Jan 2012 06:57:55 GMT</pubDate><guid isPermaLink="false">New Post: how to copy folder from windows ce device using openNETCF desktop communication library 20120118065755A</guid></item><item><title>Commented Issue: GetDeviceVersion crashes with x64 [7906]</title><link>http://rapi.codeplex.com/workitem/7906</link><description>Hello, &lt;br /&gt;&lt;br /&gt;I&amp;#39;ve downloaded the lastest version from svn respository &amp;#40;rev 45072&amp;#41; and I&amp;#39;ve noticed that CeGetVersionEx&amp;#40;out VersionInfo&amp;#41; crashes on GetDeviceVersion call when library is built for x64 platform. It works correctly on x86.&lt;br /&gt;&amp;#40;file RAPI.cs line 1136&amp;#41;.&lt;br /&gt;&lt;br /&gt;I have read the previous issues &amp;#35;5278 and &amp;#35;7045, but I have no clues, on how to resolve this issue.&lt;br /&gt;&lt;br /&gt;Do you guys have any idea &amp;#63;&lt;br /&gt;&lt;br /&gt;Herv&amp;#233;&lt;br /&gt;Comments: ** Comment from web user: NJLDoc ** &lt;p&gt;I have the same issue. Anytime the communication dll is used the program hangs raising &amp;#123;&amp;#34;Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&amp;#34;&amp;#125; I do not get the error if there is no device connected. The simple code that follows is a sample and I cannot break into code when the device is attached.&lt;/p&gt;&lt;p&gt;    Public Shared Function DevicePresentAndConnected&amp;#40;&amp;#41; As Boolean&lt;br /&gt;        Dim bSuccess As Boolean&lt;br /&gt;        Using oRapi As New RAPI&lt;br /&gt;            Try&lt;br /&gt;                If oRapi.DevicePresent Then&lt;br /&gt;                    &amp;#39;oRapi.Connect&amp;#40;&amp;#41;&lt;br /&gt;                    bSuccess &amp;#61; True&lt;br /&gt;                    &amp;#39;oRapi.Disconnect&amp;#40;&amp;#41;&lt;br /&gt;                Else&lt;br /&gt;                    bSuccess &amp;#61; False&lt;br /&gt;                End If&lt;br /&gt;            Catch ex As RAPIException&lt;/p&gt;&lt;p&gt;            End Try&lt;br /&gt;        End Using&lt;br /&gt;        Return bSuccess&lt;/p&gt;&lt;p&gt;    End Function&lt;/p&gt;</description><author>NJLDoc</author><pubDate>Tue, 17 Jan 2012 00:09:47 GMT</pubDate><guid isPermaLink="false">Commented Issue: GetDeviceVersion crashes with x64 [7906] 20120117120947A</guid></item><item><title>New Post: how to copy folder from windows ce device using openNETCF desktop communication library</title><link>http://rapi.codeplex.com/discussions/284018</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;hi&lt;/p&gt;
&lt;p&gt;this is pradeep,&lt;/p&gt;
&lt;p&gt;&lt;span style="white-space:pre"&gt;&lt;/span&gt;I working with smart device, i am creating application for windows ce device, to file transfer i use openNETCF desktop communication.dll. Now I want to copy folder from device and check whether the folder exists in the
 device or not.&lt;/p&gt;
&lt;p&gt;Please help me......&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;/div&gt;</description><author>pradeepsvv</author><pubDate>Fri, 23 Dec 2011 14:46:03 GMT</pubDate><guid isPermaLink="false">New Post: how to copy folder from windows ce device using openNETCF desktop communication library 20111223024603P</guid></item><item><title>New Post: Faulting module rapi.dll</title><link>http://rapi.codeplex.com/discussions/283430</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Below is the code i use to read a file from the scanner.&lt;/p&gt;
&lt;p&gt;This routine is executed every 5 seconds.&lt;/p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;    &lt;span style="color: blue;"&gt;Private&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; ScanDevice()
        &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; oRAPI &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;New&lt;/span&gt; RAPI
        &lt;span style="color: blue;"&gt;Try&lt;/span&gt;

            &lt;span style="color: green;"&gt;'Set remote file&lt;/span&gt;
            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; RemoteFile &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = &lt;span style="color: #a31515;"&gt;"\Application\MCL\Projects\Default\AA.dat"&lt;/span&gt;

            &lt;span style="color: green;"&gt;'Set local file&lt;/span&gt;
            &lt;span style="color: blue;"&gt;Dim&lt;/span&gt; Filename &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;String&lt;/span&gt; = &lt;span style="color: #a31515;"&gt;"C:\Temp\"&lt;/span&gt; &amp;amp; Format(DateTime.Now, &lt;span style="color: #a31515;"&gt;"yyyyMMddhhmmss"&lt;/span&gt;) &amp;amp; &lt;span style="color: #a31515;"&gt;".txt"&lt;/span&gt;

            &lt;span style="color: green;"&gt;'Check device present&lt;/span&gt;
            &lt;span style="color: blue;"&gt;If&lt;/span&gt; &lt;span style="color: blue;"&gt;Not&lt;/span&gt; oRAPI.DevicePresent &lt;span style="color: blue;"&gt;Then&lt;/span&gt; &lt;span style="color: blue;"&gt;Return&lt;/span&gt;

            &lt;span style="color: green;"&gt;'Open connection&lt;/span&gt;
            oRAPI.Connect()

            &lt;span style="color: green;"&gt;'Check device connected&lt;/span&gt;
            &lt;span style="color: blue;"&gt;If&lt;/span&gt; &lt;span style="color: blue;"&gt;Not&lt;/span&gt; oRAPI.Connected &lt;span style="color: blue;"&gt;Then&lt;/span&gt; &lt;span style="color: blue;"&gt;Return&lt;/span&gt;

            &lt;span style="color: green;"&gt;'Check remote file&lt;/span&gt;
            &lt;span style="color: blue;"&gt;If&lt;/span&gt; oRAPI.DeviceFileExists(RemoteFile) &lt;span style="color: blue;"&gt;Then&lt;/span&gt;

                &lt;span style="color: green;"&gt;'Get file size to check if the file is locked&lt;/span&gt;
                &lt;span style="color: blue;"&gt;Try&lt;/span&gt;
                    oRAPI.GetDeviceFileSize(RemoteFile)
                &lt;span style="color: blue;"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; Exception
                    &lt;span style="color: blue;"&gt;Return&lt;/span&gt;
                &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Try&lt;/span&gt;

                &lt;span style="color: green;"&gt;'Copy remote file&lt;/span&gt;
                oRAPI.CopyFileFromDevice(LocalFile, RemoteFile, &lt;span style="color: blue;"&gt;True&lt;/span&gt;)

                &lt;span style="color: green;"&gt;'Delete remote file&lt;/span&gt;
                oRAPI.DeleteDeviceFile(RemoteFile)

            &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;If&lt;/span&gt;

        &lt;span style="color: blue;"&gt;Catch&lt;/span&gt; ex &lt;span style="color: blue;"&gt;As&lt;/span&gt; RAPIException

        &lt;span style="color: blue;"&gt;Finally&lt;/span&gt;

            &lt;span style="color: green;"&gt;'Disconnect from device&lt;/span&gt;
            oRAPI.Disconnect()

            &lt;span style="color: green;"&gt;'Dispose object&lt;/span&gt;
            oRAPI.Dispose()

        &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Try&lt;/span&gt;
    &lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description><author>dietervd</author><pubDate>Mon, 19 Dec 2011 09:28:42 GMT</pubDate><guid isPermaLink="false">New Post: Faulting module rapi.dll 20111219092842A</guid></item><item><title>New Post: Faulting module rapi.dll</title><link>http://rapi.codeplex.com/discussions/283430</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;Hi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;I am using the OpenNETCF.Desktop.Communication.DLL (version 2.9.4262.14435) to read a file from a Motorola MT2070 scanner.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;I have written an application in vb.NET (Framework 4.0) that checks every 5 seconds if a file is available on the scanner.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;If a file is available it is copied from the scanner to a local folder on the pc for further processing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;The program runs fine for most of the time, but occasionally i get an error like the one below, causing the program to close.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;This problem occurs both with ActiveSync on Windows XP or with Windows Mobile Device Center on Windows 7.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;System.Runtime.InteropServices.COMException (0x80070006):
&lt;/span&gt;&lt;/em&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at OpenNETCF.Desktop.Communication.RAPI.Connect(Boolean WaitForInit, Int32 TimeoutSeconds)&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at OpenNETCF.Desktop.Communication.RAPI.Connect()&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at Scanner_Interface.FrmMain.CheckDevice()&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at Scanner_Interface.FrmMain.TimerClock_Tick(Object sender, EventArgs e)&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at System.Windows.Forms.Timer.OnTick(EventArgs e)&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message&amp;amp; m)&lt;/span&gt;&lt;/em&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&lt;br&gt;
&lt;/span&gt;&lt;em&gt;&lt;span lang="EN-US" style="color:navy; font-size:10pt"&gt;at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="color:black; font-size:10pt"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Another issue I have is that the program sometimes freezes on the &lt;strong&gt;CeGetFileAttributes&lt;/strong&gt; function in routine
&lt;strong&gt;DeviceFileExists&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;After 5 to 10 minutes the program continues again, but in the meantime the endusers have already restarted the program (with Task Manager).&lt;/p&gt;
&lt;p&gt;After restarting the program everything works fine.&lt;/p&gt;
&lt;p&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;bool&lt;/span&gt; DeviceFileExists(&lt;span style="color:blue"&gt;string&lt;/span&gt; RemoteFileName)&lt;br&gt;
{&lt;br&gt;
&lt;span style="color:green"&gt;// check for connection&lt;/span&gt;&lt;br&gt;
CheckConnection();&lt;br&gt;
&lt;br&gt;
&lt;span style="color:blue"&gt;uint&lt;/span&gt; attr = CeGetFileAttributes( RemoteFileName );&lt;br&gt;
&lt;br&gt;
&lt;span style="color:blue"&gt;if&lt;/span&gt; ( attr == 0xffffffff )&lt;br&gt;
&lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;false&lt;/span&gt;;&lt;br&gt;
&lt;br&gt;
&lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;true&lt;/span&gt;;&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;Does anyone recognize these issues ?&lt;/p&gt;
&lt;p&gt;Any help is welcome&amp;hellip;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>dietervd</author><pubDate>Mon, 19 Dec 2011 09:09:36 GMT</pubDate><guid isPermaLink="false">New Post: Faulting module rapi.dll 20111219090936A</guid></item><item><title>Reviewed: Initial Release (Dec 05, 2011)</title><link>http://rapi.codeplex.com/releases/view/29281#ReviewBy-mailvirender</link><description>Rated 1 Stars &amp;#40;out of 5&amp;#41; - &amp;#42;&amp;#42;&amp;#42;let me check</description><author>mailvirender</author><pubDate>Mon, 05 Dec 2011 20:04:13 GMT</pubDate><guid isPermaLink="false">Reviewed: Initial Release (Dec 05, 2011) 20111205080413P</guid></item><item><title>New Post: Track percentage of file copied</title><link>http://rapi.codeplex.com/discussions/281391</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Obviously to display the percentage copied you can use a timer to periodically update a label:&lt;/p&gt;
&lt;p&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; tmrCopyProgress_Tick(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, EventArgs e) {
    lblDone.Text = m_rapi.PercentageDone.ToString() + &lt;span style="color: #a31515;"&gt;"%"&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/p&gt;&lt;/div&gt;</description><author>patrict</author><pubDate>Thu, 01 Dec 2011 05:15:02 GMT</pubDate><guid isPermaLink="false">New Post: Track percentage of file copied 20111201051502A</guid></item><item><title>New Post: Track percentage of file copied</title><link>http://rapi.codeplex.com/discussions/281391</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;I have made another modification to my copy of the project and thought Id post it in case anyone else finds it useful. It may not be the perfect way to do it, but works well for my needs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overview:&lt;/strong&gt;&amp;nbsp;I have a C# desktop application that allows a user to copy files to a device. I run the actual copy process in a BackbgroundWorker.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The requirement:&lt;/strong&gt;&amp;nbsp;To be able to track the progress of the file copy.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The solution:&lt;/strong&gt;&amp;nbsp;Track the percentage copied during the file copy.&amp;nbsp;Code below (my additions in red, ellipses denote exclusion of existing code for ease of reading):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;namespace&lt;/span&gt; OpenNETCF.Desktop.Communication {
    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; RAPI : IRAPI {
	...

&lt;span style="color:#ff0000"&gt;        // Progress percentage
        private decimal m_decPercentageDone = 0;
        public decimal PercentageDone {
            get {
                return Math.Round(m_decPercentageDone);
            }
        }

        // Allow progress percentage to be reset
        public void ResetPercentage() {
            m_decPercentageDone = 0;
        }
&lt;/span&gt;
	...

        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; CopyFileToDevice(&lt;span style="color:blue"&gt;string&lt;/span&gt; LocalFileName, &lt;span style="color:blue"&gt;string&lt;/span&gt; RemoteFileName, &lt;span style="color:blue"&gt;bool&lt;/span&gt; Overwrite)
        {
	    ...

            &lt;span style="color:green"&gt;// open the local file&lt;/span&gt;
            localFile = &lt;span style="color:blue"&gt;new&lt;/span&gt; FileStream(LocalFileName, FileMode.Open, FileAccess.Read);

&lt;span style="color:#ff0000"&gt;            // Get the size of the complete file
            decimal lngFileSize = localFile.Length;
&lt;/span&gt;	    ...

            &lt;span style="color:blue"&gt;while&lt;/span&gt; (bytesread &amp;gt; 0) {
	       ...

&lt;span style="color:#ff0000"&gt;                // Calculate the percentage copied
                lowsize = CeGetFileSize(remoteFile, ref highsize);
                if (lowsize == uint.MaxValue) {
                } else {
                    m_decPercentageDone = (decimal)((lowsize &amp;#43; (highsize &amp;lt;&amp;lt; 32)) / lngFileSize) * 100;
                }
&lt;/span&gt;            }
        ...

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As you can see, if I am unable to get the percentage done I do nothing - I figure that the file copy is more important than the progress reporting... Please feel free to improve this - I am extremely new to C# so I figured most of this out by looking at
 existing code.&lt;/p&gt;
&lt;p&gt;I have implemented this in the CopyFileFromDevice()&amp;nbsp;method as well, but Im sure you can figure it out based on the above (in fact its more simple because you can use localfile.length to get the size of what has already been copied from the device, instead
 of having to use CeGetFileSize()...).&lt;/p&gt;
&lt;p&gt;Happy coding!&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt;
Patric&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>patrict</author><pubDate>Thu, 01 Dec 2011 05:11:29 GMT</pubDate><guid isPermaLink="false">New Post: Track percentage of file copied 20111201051129A</guid></item><item><title>New Post: Interrupting copy of large files</title><link>http://rapi.codeplex.com/discussions/279094</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;First post, so firstly thank you for a great library - I have just started with C# .Net and mobile development, and this has really made my life easier!&lt;/p&gt;
&lt;p&gt;I have encountered (and been able to resolve) the following problem. I have only been working with C# for a month I will show you what I have done and leave up to you what would be the best/most correct way to implement it into the project (if you so wish
 of course).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overview:&lt;/strong&gt; I have a desktop application that allows a user to copy files to a device. I run the actual copy process in a BackbgroundWorker.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The scenario:&lt;/strong&gt; Sometimes the files to be copied may be large, and as such I would like to allow the user the option to cancel the copy.&amp;nbsp;Sending a&amp;nbsp;CancelAsync() to the&amp;nbsp;BackbgroundWorker will tell the worker thread that it should
 stop running at a safe point, but for this to happen the current file copy must first complete.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The problem:&lt;/strong&gt; There is no way to interrupt the file copy&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The solution:&lt;/strong&gt; Add an InterruptCopy flag to the rapi class which will allow one to break out of the file copy process. Code below (my additions in red, ellipses denote exclusion of existing code for ease of reading):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;namespace&lt;/span&gt; OpenNETCF.Desktop.Communication {
    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; RAPI : IRAPI {
	...
&lt;span style="color:#ff0000"&gt;&lt;br&gt;	&lt;/span&gt;&lt;span style="color:#ff0000"&gt;private&lt;/span&gt;&lt;span style="color:#ff0000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;bool&lt;/span&gt;&lt;span style="color:#ff0000"&gt; m_blnInterruptCopy = &lt;/span&gt;&lt;span style="color:#ff0000"&gt;false&lt;/span&gt;&lt;span style="color:#ff0000"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style="color:#ff0000"&gt;        public bool InterruptCopy {
            get {
                return m_blnInterruptCopy;
            }
            set {
                m_blnInterruptCopy = value;
            }
        }
&lt;/span&gt;
		
        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; CopyFileToDevice(&lt;span style="color:blue"&gt;string&lt;/span&gt; LocalFileName, &lt;span style="color:blue"&gt;string&lt;/span&gt; RemoteFileName, &lt;span style="color:blue"&gt;bool&lt;/span&gt; Overwrite) {
	    ...

            &lt;span style="color:green"&gt;// read 4k of data&lt;/span&gt;
            bytesread = localFile.Read(buffer, filepos, buffer.Length);
&lt;span style="color:#ff0000"&gt;            m_blnInterruptCopy = false;&lt;/span&gt;
            &lt;span style="color:blue"&gt;while&lt;/span&gt; (bytesread &amp;gt; 0) {
&lt;span style="color:#ff0000"&gt;                // Check if we must interrupt the copy process
                if (m_blnInterruptCopy) {
                    break;
                }
&lt;/span&gt;				
                &lt;span style="color:green"&gt;// move remote file pointer # of bytes read&lt;/span&gt;
                filepos &amp;#43;= bytesread;

                &lt;span style="color:green"&gt;// write our buffer to the remote file&lt;/span&gt;
                &lt;span style="color:blue"&gt;if&lt;/span&gt; (!Convert.ToBoolean(CeWriteFile(remoteFile, buffer, bytesread, &lt;span style="color:blue"&gt;ref&lt;/span&gt; byteswritten, 0))) { &lt;span style="color:green"&gt;// check for success&lt;/span&gt;
                    CeCloseHandle(remoteFile);
                    &lt;span style="color:blue"&gt;throw&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; RAPIException(&lt;span style="color:#a31515"&gt;&amp;quot;Could not write to remote file&amp;quot;&lt;/span&gt;);
                }
                &lt;span style="color:blue"&gt;try&lt;/span&gt; {
                    &lt;span style="color:green"&gt;// refill the local buffer&lt;/span&gt;
                    bytesread = localFile.Read(buffer, 0, buffer.Length);
                }
                &lt;span style="color:blue"&gt;catch&lt;/span&gt; (Exception) {
                    bytesread = 0;
                }
	    }
			
            &lt;span style="color:green"&gt;// close the local file&lt;/span&gt;
            localFile.Close();

            &lt;span style="color:green"&gt;// close the remote file&lt;/span&gt;
            CeCloseHandle(remoteFile);

&lt;span style="color:#ff0000"&gt;            // If the copy was interrupted then remove the incomplete file
            if (m_blnInterruptCopy) {
                DeleteDeviceFile(RemoteFileName);
            } else {
&lt;/span&gt;                &lt;span style="color:green"&gt;// sync the date/times&lt;/span&gt;
                SetDeviceFileTime(RemoteFileName, RAPIFileTime.CreateTime, File.GetCreationTime(LocalFileName));
                SetDeviceFileTime(RemoteFileName, RAPIFileTime.LastAccessTime, DateTime.Now);
                SetDeviceFileTime(RemoteFileName, RAPIFileTime.LastModifiedTime, File.GetLastWriteTime(LocalFileName));
            &lt;span style="color:#ff0000"&gt;}&lt;/span&gt;
        }
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then when I want to interrupt the copy of a large file in my code, I simply set the InterruptCopy flag to true:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;m_rapi.InterruptCopy = &lt;span style="color:blue"&gt;true&lt;/span&gt;;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Obviously this can be extended to other file actions.&lt;/p&gt;
&lt;p&gt;I hope this is a useful addition, I know that I searched for a solution for about 4 hours before I decided to brave trying it myself :)&lt;/p&gt;
&lt;p&gt;Regards,&amp;nbsp;&lt;br&gt;
Patric&lt;/p&gt;
&lt;/div&gt;</description><author>patrict</author><pubDate>Fri, 11 Nov 2011 09:16:52 GMT</pubDate><guid isPermaLink="false">New Post: Interrupting copy of large files 20111111091652A</guid></item><item><title>New Post: support for .net 4 framework projects</title><link>http://rapi.codeplex.com/discussions/277835</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am currently doing a WPF project based on .net 4 framework.&lt;/p&gt;
&lt;p&gt;The application needs to connect to a mobile device using opennetcf dlls. I have made this to on Debug mode, but if I compile it in Release mode, it throws an error saying that the library is not compatible with .net 4.&lt;/p&gt;
&lt;p&gt;I have also tried compiling the opennetcf project as .net 4,&amp;nbsp;and add the reference to my wpf project. Still it does not let me compile in release mode.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>sparco</author><pubDate>Tue, 01 Nov 2011 00:27:31 GMT</pubDate><guid isPermaLink="false">New Post: support for .net 4 framework projects 20111101122731A</guid></item><item><title>New Post: copyFile to device</title><link>http://rapi.codeplex.com/discussions/276062</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I checked discussions but couldn't find the answer on the issue about copying a file from the desktop to the device.&lt;/p&gt;
&lt;p&gt;I get the error &amp;quot;could not create remote file&amp;quot; so what should I do?&lt;/p&gt;
&lt;p&gt;I use version&amp;nbsp;2.9.4218.21446 of the&amp;nbsp;OpenNETCF.Desktop.Communication.DLL&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Computer runs Windows 7 professional (64bit)&lt;/p&gt;
&lt;p&gt;PDA uses Windows CE Professional&lt;/p&gt;
&lt;p&gt;best regards&lt;/p&gt;
&lt;p&gt;Frank Boonen&lt;/p&gt;
&lt;/div&gt;</description><author>FrankBoonen</author><pubDate>Sun, 16 Oct 2011 15:16:56 GMT</pubDate><guid isPermaLink="false">New Post: copyFile to device 20111016031656P</guid></item><item><title>New Post: How do I access a file?</title><link>http://rapi.codeplex.com/discussions/273230</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Thanks.&amp;nbsp; I had just figured it out.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My mistake was that I was using the local file and remote file in the wrong places in the call to CopyFileFromDevice().&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the speedy reply.&lt;/p&gt;&lt;/div&gt;</description><author>timjurik</author><pubDate>Tue, 20 Sep 2011 19:09:46 GMT</pubDate><guid isPermaLink="false">New Post: How do I access a file? 20110920070946P</guid></item><item><title>New Post: How do I access a file?</title><link>http://rapi.codeplex.com/discussions/273230</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;VB.Net:&lt;/p&gt;
&lt;p&gt;Imports OpenNETCF.Desktop.Communication&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Function DoesCEFileExist(ByVal FileName As String) As Boolean&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectToiPAQ()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return myrapi.DeviceFileExists(FileName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisconnectFromIpaq()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub ConnectToiPAQ()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If myrapi.DevicePresent Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.Connect()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Please connect your device to your PC using ActiveSync/WMDC before clicking the OK button.", "Device was not detected")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If myrapi.DevicePresent Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.Connect()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Please connect your device to your PC using ActiveSync/WMDC before clicking the OK button. If you have just docked your unit, please wait for ActiveSync/WMDC to start up and connect to your devicebefore pressing OK", "Device still has not been detected")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If myrapi.DevicePresent Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.Connect()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Please verify " &amp;amp; Me.SyncMethod() &amp;amp; " is running and displays 'Connected' before clicking the OK button. If the device cannot be detected at this point, this application will shut down.", "Device was not detected, last try.")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If myrapi.DevicePresent Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.Connect()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw New Exception("DeviceNotConnected")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub DisconnectFromIpaq()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.Disconnect()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub CopyFilefromDeviceToPC()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectToiPAQ()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If DoesCEFileExist(DevicePath + FileName) = True Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myrapi.CopyFileFromDevice(SourcePath &amp;amp; File, DevicePath &amp;amp; File)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw New Exception("ErrorCopyingFileFromDevice:" &amp;amp; ex.Message)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Throw New Exception("FiledoesntExistOnDevice") &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DisconnectFromIpaq()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>DavyMac</author><pubDate>Tue, 20 Sep 2011 18:55:30 GMT</pubDate><guid isPermaLink="false">New Post: How do I access a file? 20110920065530P</guid></item><item><title>New Post: How do I access a file?</title><link>http://rapi.codeplex.com/discussions/273230</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I cannot seem to get the file copy or any other method to work.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can connect to the device - but what type of address scheme is the file system/file naming format.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I do not understand how to do what I want which is:&lt;/p&gt;
&lt;p&gt;- Copy a file (or a directory) from the device to my local computer.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;/div&gt;</description><author>timjurik</author><pubDate>Tue, 20 Sep 2011 18:38:33 GMT</pubDate><guid isPermaLink="false">New Post: How do I access a file? 20110920063833P</guid></item><item><title>Created Issue: Problems with RAPI.Invoke [8680]</title><link>http://rapi.codeplex.com/workitem/8680</link><description>Hello&amp;#33;&lt;br /&gt;&lt;br /&gt;Todays I&amp;#39;ve faced with a bug inside RAPI.Invoke method. Before executing CeRapiInvoke, the method copies data from the byte array into HGLOBAL&amp;#58;&lt;br /&gt;&lt;br /&gt;public void Invoke&amp;#40;string DLLPath, string FunctionName, byte&amp;#91;&amp;#93; InputData, out byte&amp;#91;&amp;#93; OutputData&amp;#41;&lt;br /&gt;&amp;#123;&lt;br /&gt; &amp;#47;&amp;#47; ... &lt;br /&gt;&lt;br /&gt;&amp;#47;&amp;#47; copy outgoing data to the pointer - too bad we don&amp;#39;t have a memcpy fcn&lt;br /&gt; for&amp;#40;int i &amp;#61; 0 &amp;#59; i &amp;#60; InputData.Length &amp;#59; i&amp;#43;&amp;#43;&amp;#41;&lt;br /&gt; &amp;#123;&lt;br /&gt; Marshal.WriteInt16&amp;#40;sendData, i, InputData&amp;#91;i&amp;#93;&amp;#41;&amp;#59;&lt;br /&gt; &amp;#125;&lt;br /&gt;&lt;br /&gt; &amp;#47;&amp;#47; ...&lt;br /&gt;&amp;#125;&lt;br /&gt;&lt;br /&gt;The problem is that it uses WriteInt16 instead of WriteByte method which leads to memory corruption, since it is always written one byte more than it was allocated.&lt;br /&gt;</description><author>Nuzikprogrammer</author><pubDate>Mon, 12 Sep 2011 02:51:57 GMT</pubDate><guid isPermaLink="false">Created Issue: Problems with RAPI.Invoke [8680] 20110912025157A</guid></item><item><title>New Post: Can not get CopyFileToDevice to work under WCF Service</title><link>http://rapi.codeplex.com/discussions/271959</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;OS: Win 7 Utlimate 32bits&lt;/p&gt;
&lt;p&gt;Service developed in VS2010 and Mobile app in VS2008&lt;/p&gt;
&lt;p&gt;2 Devices: 1 in Pocket PC 2003 &amp;amp; 1 in Mobile 6&lt;/p&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using OpenNETCF.Desktop.Communication library version 2.9.4 with my WCF service using VS2010. The service is called from a MVC web application but I am testing it from the .Net tool WcfTestClient.exe. My service is extracting data from the database
 when the WCF service method is called. It create Xml file to a folder and the OpenNet communication dll copy the Xml file on to the device.&lt;/p&gt;
&lt;p&gt;When I ran the service under debug from VS2010, and add service under localhost:xxxx (port no), the service seems copy to the device correctly. When I published to local IIS it's failed to copy the Xml file to the device. I guess it might be some sort of
 permission but I am not sure where to look.&lt;/p&gt;
&lt;p&gt;I am pretty new to WCF service development and my knowledge of IIS 6 &amp;amp; 7 not terrific, any one can help will be great. Thanks for reading and help.&lt;/p&gt;
&lt;p&gt;Punprom.&lt;/p&gt;
&lt;/div&gt;</description><author>punprom</author><pubDate>Thu, 08 Sep 2011 18:06:26 GMT</pubDate><guid isPermaLink="false">New Post: Can not get CopyFileToDevice to work under WCF Service 20110908060626P</guid></item><item><title>New Post: function calls fail without reason</title><link>http://rapi.codeplex.com/discussions/269092</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi everyone&lt;/p&gt;
&lt;p&gt;I'm using desktop communication library for about a year now, I just recently switched my hand held from a WinCE5 to a WM6 Pro one, now all the function calls like reading a registry key, device file exist, copy from device, simply fail without providing
 any info, I used rapi calls directly and it is the same.&amp;nbsp;however&amp;nbsp;it can detect&amp;nbsp;that&amp;nbsp;the device is present and&amp;nbsp;the&amp;nbsp;connected disconnected events are fired accordingly. can anyone please help me with the matter?&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Device &amp;amp; program Info:&lt;/p&gt;
&lt;p&gt;Windows Mobil 6 Professional&lt;/p&gt;
&lt;p&gt;.NetCF 3.5&lt;/p&gt;
&lt;/div&gt;</description><author>massar</author><pubDate>Mon, 15 Aug 2011 09:15:11 GMT</pubDate><guid isPermaLink="false">New Post: function calls fail without reason 20110815091511A</guid></item></channel></rss>
