# Friday, April 02, 2004

All about RAPI

If you are writing a desktop application to talk to your device-side software, chances are you'll need to work with the Remote API (RAPI). This article by Larry Roof describes RAPI and uses OpenNETCF's Communication library to copy files, launch programs and query settings on the device.

#    |
# Wednesday, March 31, 2004

New blog in town

The Windows Mobile "Developer Experience" team have launched a new blog, Robert has already made a few posts regarding developing for Windows Mobile 2003 Second Edition.

#    |
# Monday, March 29, 2004

Back from San Francisco

I've got back home from MDC, my immediate task is to clear the backlog of emails and serious sleep deprivation! I'll also be pulling together all my notes on the event for a Smartphone / Pocket PC Thoughts article.

The event included a great mixture of short term and longer-term announcements. Windows Mobile 2003 Second Edition brings support for a greater range of form factors for devices. After some deliberation I decided not to get my iPaq 2210 flashed as the beta image excluded any Bluetooth support, which would cripple the device which I use day-to-day. I have of course installed the Emulator images to target the platform. Longer term, Visual Studio 2005, .NET Compact Framework 2.0 and SQL Server Mobile are shaping up to be a powerful set of tools and technologies, and I can't wait to play with the preview version of Visual Studio 2005 that was handed out!

#    |
# Saturday, March 20, 2004

Smartphone files article gone live

Thanks to Geoff Schwab for the heads up. My article on working with files covering Storage Cards and File Dialogs is now up in the MSDN library.

#    |
# Friday, March 19, 2004

Free space on Storage Cards

You can determine the total size of a Storage Card and available free bytes using the GetDiskFreeSpaceEx API function. Below is a "mini-wrapper" around the function which returns a structure with the three return values. You'll notice in this example I'm marshalling longs (64bit Integers), values greater than 32bit cannot be marshalled by value but can be marshalled by reference as in this case. The DiskFreeSpace struct contains three long members to hold the accessible free bytes, total bytes and total free bytes.

public static DiskFreeSpace GetDiskFreeSpace(string directoryName)
{
    DiskFreeSpace result = new DiskFreeSpace();

    if(!GetDiskFreeSpaceEx(directoryName, ref result.FreeBytesAvailable,
        ref result.TotalBytes, ref result.TotalFreeBytes))
    {
        throw new Win32Exception(Marshal.GetLastWin32Error(), "Error retrieving free disk space");
    }
    return result;
}

public struct DiskFreeSpace
{
    public long FreeBytesAvailable;
    
    public long TotalBytes;
    
    public long TotalFreeBytes;
}

[DllImport("coredll")]
private static extern bool GetDiskFreeSpaceEx(string directoryName,
    ref long freeBytesAvailable,
    ref long totalBytes,
    ref long totalFreeBytes);

 

Or if you prefer Visual Basic:-

Public Function GetDiskFreeSpace(ByRef directoryName As String) As DiskFreeSpace

    Dim result As New DiskFreeSpace

    If GetDiskFreeSpaceEx(directoryName, result.FreeBytesAvailable, result.TotalBytes, result.TotalFreeBytes) = False Then

        Throw New System.ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), "Error retrieving free disk space")

    End If

    Return result

End Function

Public Structure DiskFreeSpace

    Public FreeBytesAvailable As Long

    Public TotalBytes As Long

    Public TotalFreeBytes As Long

End Structure

Private Declare Function GetDiskFreeSpaceEx Lib "coredll.dll" (ByVal directoryName As String, ByRef freeBytesAvailable As Long, ByRef totalBytes As Long, ByRef totalFreeBytes As Long)

#    |
# Thursday, March 18, 2004

A day of upgrades

I followed Neil and Alex's lead and upgraded my blog to dasBlog too. Luckily because dasBlog is an evolution of BlogX the migration was pretty smooth. I may well tweak the theme slightly yet though because I miss my roadsign :-)

I've also flashed my iPaq 2210 with the latest 1.10 ROM (Thanks to Ed at Pocket PC Thoughts for the heads up). This includes a number of previous patches, sadly it has .NETCF SP1, not SP2 so that will still require a RAM install. However doing a ROM flash is always a good time to clean out the crud so my iPaq is nice and tidy (for the moment at least)

#    |
# Thursday, February 19, 2004

So what do you think of OpenNETCF?

The OpenNETCF Survey

As we are approaching our first anniversary (and so is the .NET Compact Framework itself which was officially announced last March) we are interested to understand what you think of the code, articles etc we have created so far and what you would like to see from us in the future. We would really appreciate it if you could spare a few minutes to fill in our short survey, you can fill it anonymously if you like or if you provide details you'll be entered into a draw for some secret OpenNETCF goodies - we'll announce the winner during the upcoming MDC 2004 week.

 

#    |

Microsoft Mobile Dev Con just over a month away

Kevin Lisota has just posted about his excitement for the upcoming MDC in San Francisco. It's shaping up to be a really interesting event and of course OpenNETCF will be providing an exciting session:-

"CLI345 - Developing Real-world Smart Device Applications with Visual Studio .NET 2003, .NET Compact Framework and OpenNETCF SmartDevice Framework
The .NET Compact Framework is a powerful tool for a mobile developer. To fully utilize its potential in a real-world application, a developer needs access to the native API and intrinsic Windows CE controls. OpenNETCF SmartDevice framework is designed to address these needs."
 
There will also be a number of worldwide events to follow offering MDC content nearer to you.


#    |