Friday, December 03, 2004

As you probably know that if you would want to implement a full “kiosk” mode on Pocket PC – which means that you need to hide the “Start” and SIP buttons to prevent users getting into underlying system. It’s easy to employ – just remove a MainMenu from a Form, set ControlBox to false and set the WindowState = FormWindowState.Maximized in the form’s Load event. But what if I still need clients to use SIP to enter some text? We could use the SipShowIM API, but this call will make the SIP button to appear again breaking the “kiosk” mode. So, to solve this puzzle I’ve created the SIPControl  - an owner-drawn control that allows creation of any type of SIP’s. Here’s the code snip that shows how to create a full SIP keyboard on your form:

sipFull = new SIPControl();

                 

// Location and size

sipFull.Location = new Point(1, 60);

sipFull.Size =    new Size(240, 90);

     

//Create ButtonRows

ButtonRow row1 = new ButtonRow(new string[]{"Q","W","E","R","T","Y","U","I","O","P"}, 1, 0);

row1.Space = 4;

// Add ButtonRow to the Rows collection

sipFull.Rows.Add(row1);

ButtonRow row2 = new ButtonRow( new string[]{"A","S","D","F","G","H","J","K","L"}, 10, 22);

row2.Space = 4;

sipFull.Rows.Add(row2);

ButtonRow row3 = new ButtonRow( new string[]{"Z","X","C","V","B","N","M"}, 30, 44);

row3.Space = 4;

sipFull.Rows.Add(row3);

ButtonRow row4 = new ButtonRow(  new string[]{"1","2","3","4","5","6","7","8","9","0"}, 1, 66);

row4.Space = 4;

sipFull.Rows.Add(row4);

                 

// Hook up the Click event

sipFull.ButtonClick+=new ButtonClickEventHandler(sipFull_ButtonClick);

this.Controls.Add(sipFull);        

 And here’s how the sample looks:

 

You can download the SIPControl and a sample from here.

SIPTest.zip (7.8 KB)
12/3/2004 4:44:53 PM (GMT Standard Time, UTC+00:00)  #     | 
 Tuesday, November 23, 2004

In his recent post Alex Feinman shows how to create XmlDataSource. This is a really great and usefull piece of code that shows how to implement databinding by the means of xml file.

If your your XML data is not that complex and close to the DataSet's xml serialized schema you can use the Paul Wilson's Open-Source ADO.NET XML Provider, that implements appropriate .NET Framework Data Provider interfaces and allows accessing and filtering the XML data by way of sql statements. I've ported the code for Compact Framework. Here's the screen shot of a sample client:

You can download the source code from here.

XmlDbProvider.zip (147.42 KB)

 

11/23/2004 7:48:30 PM (GMT Standard Time, UTC+00:00)  #     | 
 Wednesday, November 17, 2004

Chris Forsberg of pocketpcdn reminds us about this really cool resource created by Microsoft: We Rock 247. The Smart Client Sample download includes all required SDK's, tools and a source code for web client, winform client, web services and mobile client. The mobile part includes a few applications for Pocket PC and Smartphone (Packman and RoadRunner) and shows how to implement MVC pattern, MD5 password hashing, exception tracing, database wrapper (a la stored procedures), forms stack and many more really useful stuff.

11/17/2004 7:25:36 PM (GMT Standard Time, UTC+00:00)  #     | 
 Thursday, November 11, 2004

Recently I've come upon this diamond in the MSDN library Improving .NET Application Performance and Scalability. It's in fact an actual book where each chapter is a choke full of invaluable tips on how to create performant and scalable applications in .NET. A must read for every .NET developer experienced or not.

11/11/2004 1:27:29 PM (GMT Standard Time, UTC+00:00)  #     | 
 Monday, October 18, 2004

Everybody has been talking about Service-Oriented Architecture (SOA) lately. And it’s not about Web Services, but essentially about service been abstracted from the implementation, published specs of its interface and a formal contract between service provider and its customer.  So, mostly it is about standards in the communication between different platforms and systems – this is where SOAP, WSE (Indigo in the future) come to play. It’s all nice and dandy when you develop SOA systems for desktops/servers, but we’d immediately step into uncharted territory if you try to apply SOA principals when developing for mobile devices. Yes, we can call to Web Services from .NET CF client, we can even communicate with servers which implement WSE (big thanks to Casey for his wonderful work here), but you’d fall short if your project should require a 2 way real-time communication with a desktops or other devices in the almost always connected (WIFI) environment. So this rant is to bring attention of Microsoft folks on this very important subject. Mobile devices are not only used in the end-user retail environment, but also in the enterprise. We need WSE or Indigo for mobile devices.

10/18/2004 3:03:05 AM (GMT Daylight Time, UTC+01:00)  #     | 
 Thursday, September 30, 2004

You have probably heard about .NET to Go Mobility Road Show. It is a “FREE deeply technical and eminently useful mobile applications solutions workshop”. I am all setup at New York location for the partner / “Ask the Experts” table. Swing by to say hello or any other questions you might have.

9/30/2004 2:21:04 PM (GMT Daylight Time, UTC+01:00)  #    Comments [34]  | 
 Tuesday, September 14, 2004

In this old post of mine I was asking for more access to the native windows and graphics handles in CF. Things are really getting better in the Compact Framework V2. We get what we were asking for.  The Graphics.FromHdc is there, as well as Bitmap.LockBits (UnlockBits) and Image.Save. Although the Bitmap.GetHbitmap and Image.FormHandle are still seems to be missing.

We still don't have the ability to access WinProc of the managed control or to host a native control in the managed environment, but hopefully this will be changed when (if) CF V2 will support native callbacks.

9/14/2004 2:34:51 PM (GMT Daylight Time, UTC+01:00)  #     | 
 Wednesday, September 08, 2004

A lot of questions on inter process communication (IPC) in Compact Framework have recently popped up on the CF NG. And one of the options for IPC is to use Memory Mapped Files (MMF). So what are those? Here's the quote from MSDN documentation:

“A memory-mapped file, or file mapping, is the result of associating a file's contents with a portion of the virtual address space of a process. It can be used to share a file or memory between two or more processes...”

Windows CE supports both named and unnamed file-mapping objects. I'd say that named object to be more useful.  If the created object has a name you can easily pass that name to other processes so these processes can access the same object.

While doing investigation on my current project possibility of IPC, I've made some research on available C# code that wraps MMF. I've found quite a few implementations available on various web sites (CodeProject.com, Gotdotnet.com, etc...), but I've decided to port the implementation of MemoryMappedFileStream that comes with the Smart Client Offline Application Block. The conversion to CF was easy - changed the import dll to coredll.dll and added some functionality to handle named MMF's.

You can download the project from here.

9/8/2004 6:52:00 PM (GMT Daylight Time, UTC+01:00)  #     |