Geeks With Blogs

News
WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.
Disclaimer

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Inside and Out... An attempt to understand technology better...
At the last Mobile and Embedded DevCon held at Bangalore, India, I spoke about the Windows CE Remote API, better known as RAPI.

RAPI is currently not available in the .NET Framework. To alleviate this issue, I have started working on a managed RAPI to get the functionality in the managed world - following is how the code looks like:
                                CERapi rapi = new CERapi();
			
			if (rapi.Init(5000) != InitReturnCode.Success)
				Console.WriteLine("Unable to initialize RAPI");
			else
			{
				Console.WriteLine("Initialized RAPI");

				CESystemInformation si = rapi.SystemInformation;

				// Processor Details
				Console.WriteLine("Processor Architecture: {0}",si.ProcessorType.ToString());
				Console.WriteLine("Processor Level: {0}",si.ProcessorLevel);

				// OS Details
				Console.WriteLine("OS: {0}",si.OSPlatform.ToString());
				Console.WriteLine("Version: {0}.{1}.{2}",si.MajorVersion,si.MinorVersion,si.BuildNumber);
				Console.WriteLine("CSD: {0}",si.CSDVersion);

				// Storage Details
				Console.WriteLine("Total Storage: {0} MB",si.StoreTotalSize/(1024.0*1024.0));
				Console.WriteLine("Free Storage: {0} MB",si.StoreFreeSize/(1024.0*1024.0));

				Console.WriteLine("Temp Folder: {0}",si.TempFolderPath);
				Console.WriteLine("Programs Folder: {0}",si.GetSpecialFolder(CESpecialFolder.Programs));
				
				// shutdown RAPI
				if (rapi.Shutdown() == false)
					Console.WriteLine("Unable to shutdown RAPI");
			}
And heres' the sample output:

Posted on Tuesday, February 15, 2005 10:11 AM VS.NET 2002/2003 , VS 2005 , .NET Compact Framework , Embedded Development | Back to top


Comments on this post: Welcome Windows CE Remote API (RAPI) to the managed world

# Download CERapi - the managed Windows CE Remote API
Requesting Gravatar...

Windows CE Remote API (RAPI) is the mechanism via which desktop applications can talk with the Windows...
Left by Inside and Out... on Jul 10, 2006 8:32 PM

Your comment:
 (will show your gravatar)


Copyright © Gaurav Khanna | Powered by: GeeksWithBlogs.net