Results 1 to 10 of 10

Thread: Connection paths PDA -> server

  1. #1

    Thread Starter
    Addicted Member Mandelbrot's Avatar
    Join Date
    Aug 2001
    Location
    Work, as usual!!
    Posts
    241

    Connection paths PDA -> server

    Dear All,


    I'm new to developing with PDAs, and will be asking quite a few questions about the topic from here on!

    Is there any simple way to tell if my PDA is connected to my PC viewing from the PDA side? I do have code to tell the other way round, but this isn't as muh of a worry. Alternatively, how do I refer to files on a server - how do I structure the path?


    Thanks in advance,
    Paul.

  2. #2
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Connection paths PDA -> server

    If your PDA has not got a wifi card or grps you can check for an ipaddress (as one is assigned to the device when docked with the pc)

    Alternatively you could try a webrequest from the device and if it fails it means its not connected

    Or try this code below for checking if activesync is active on the device.

    VB Code:
    1. <DllImport("CoreDll.DLL", SetLastError:=True)> _
    2. Private Shared Function CreateProcess(ByVal imageName As String, _
    3. ByVal cmdLine As String, _
    4. ByVal lpProcessAttributes As IntPtr, _
    5. ByVal lpThreadAttributes As IntPtr, _
    6. ByVal boolInheritHandles As Int32, _
    7. ByVal dwCreationFlags As Int32, _
    8. ByVal lpEnvironment As IntPtr, _
    9. ByVal lpszCurrentDir As IntPtr, _
    10. ByVal si() As Byte, _
    11. ByVal pi As ProcessInfo) As Integer
    12. End Function
    13.  
    14. Public Class ProcessInfo
    15. Public hProcess As IntPtr
    16. Public hThread As IntPtr
    17. Public ProcessId As Int32
    18. Public ThreadId As Int32
    19. End Class
    20.  
    21. Public Function RunSync()
    22. Dim si(128) As Byte
    23. Dim pi As New ProcessInfo
    24. CreateProcess("\windows\repllog.exe", "/remote", IntPtr.Zero, IntPtr.Zero, 0, 0, IntPtr.Zero, IntPtr.Zero, si, pi)
    25. End Function
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  3. #3

    Thread Starter
    Addicted Member Mandelbrot's Avatar
    Join Date
    Aug 2001
    Location
    Work, as usual!!
    Posts
    241

    Re: Connection paths PDA -> server

    Strider,


    Many thanks for your informative and swift reply. I have thought about the ActiveSync choice, but unfortunately the device does not actually end AS automatically.

    I've given your suggestion about the IP address a try, and do get a response on that. For some reason, even though the file exists, the FileInfo class I create seems to have a value of nothing, thus the resulting attempt to check for the existence of the file (in the code below) always returns a false, even though the code executes without exceptions.
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            'Check the network to see if we can find a specified file or whatever...
            Dim netConnect As New System.IO.FileInfo("\\Morph1\Sys$\Donhost.ins")
            TextBox1.Text = netConnect.Exists.ToString
        End Sub

    Paul.

  4. #4
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Connection paths PDA -> server

    On your device can you access that location ("\\Morph1\Sys$\Donhost.ins") if you browse to it in the File Explorer? Does it ask you for user name and password?
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  5. #5
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Connection paths PDA -> server

    also you will need make sure that it is a shared directory you are trying to access as otherwise permissions will fail and return false!!!!
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  6. #6

    Thread Starter
    Addicted Member Mandelbrot's Avatar
    Join Date
    Aug 2001
    Location
    Work, as usual!!
    Posts
    241

    Re: Connection paths PDA -> server

    Hmm... I'm not quite sure if the PDA is set-up properly. I think I need to check that more first. It seems that, even though I know the server and share exist and are accessible, that the PDA can't attach.

    Thanks for your help, Barry. I think this is a PDA setup issue, so I'm going to have a deeper look at what should be setup and where.


    Paul.

  7. #7
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Connection paths PDA -> server

    what type of device are you using?? pocket pc or windows ce OS??
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  8. #8

    Thread Starter
    Addicted Member Mandelbrot's Avatar
    Join Date
    Aug 2001
    Location
    Work, as usual!!
    Posts
    241

    Re: Connection paths PDA -> server

    I'm using an iPAQ hx4700 running PPC WM2003(2nd Edition). Like I say, though - this is the first time I've ever had the pleasure, and it is quite a nice little box of tricks.

    I've got a project on to write an auditable diary system. It's been an uphill struggle all the way. I only started properly using .NET about a couple of months ago. I found that the biggest problem was getting my head around the structure, but now - it's the best thing since sliced bread!!

  9. #9
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Re: Connection paths PDA -> server

    ya its pretty good, but the current version of the .Net compact framework is limited, the full version 2.0 of CF.Net will be released wit visual studio 2005 which i assume will be a lot better.

    Also there is an open source community for the .Net framework. www.opennetcf.org
    This will come in quiet handy
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

  10. #10

    Thread Starter
    Addicted Member Mandelbrot's Avatar
    Join Date
    Aug 2001
    Location
    Work, as usual!!
    Posts
    241

    Re: Connection paths PDA -> server

    Thanks for all your help Barry - you're a star, mate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width