C

How to Debug/Deploy WinRT/Windows 8 App to ARM Tablet

You’ve now made your app and tested it on desktop and want to use the same code for your developer unlocked the tablet. Until there’s an ARM version of Visual Studio, here’s what you can do. The basic process would be to set up a Remote Debugger service on your tablet and from a desktop on the same subnet, run on it directly. This assumes you have a development tablet device and a desktop running the same user (who also has admin rights) Read More…

Sharing to Facebook/Twitter from Windows 8/WinRT App

Sharing on “Metro style”/”Windows Store” app is a bit different from what we used to. Instead of invoking it directly in code, Microsoft encourages us to use the centralised “charm” bar where we would then implement a page event handler to fill in details to share.

To personalise share details, we would fill a DataPackage that would then be used across various media such as email or message or other apps. Read More…

Determining Run-Time/DesignMode in .NET

Suppose you fill your table with data from a database, you wouldn’t want it to do so while in Visual Studio’s Designer. Control.DesignMode ought to be the perfect property to check for in your form initialisations but unfortunately, it’s so buggy that it hardly does what you need. It doesn’t work in the constructors and have problems with user controls.

Then people tend to use

If (Process.GetCurrentProcess().ProcessName == "devenv")

which works fine if you call it once but inside a key user control’s initialiser, it may be called hundreds of time and cause a massive memory leak. Currently, the ProcessName string never gets freed and fills up memory very fast. Instead, save the process name in your own global variable when the program starts and check against

If (MyProcessName == "devenv")

instead.

DataGridView Change Cell Data Type After Binding

I don’t know actually since most of the relevant stuff becomes read-only after filling with data. But my approach is solve this as early on in the process as possible to the entirety of the data and save processing time on a custom loop after.

In other words, your DataGridView is typically bound to a DataTable. That is typically filled with stuff from the database. Make sure your AutoGenerateColumns property is set to true in the DataGridView and select your data to match the type you want to display in the DataGridView. For instance, to get checkboxes,

SELECT ..., CAST(column1 AS bit), ... FROM ...

and change the data type right out of the DataAdapter and DataGridView will figure out the rest automatically

Guide for MSP430 Wireless Communication

Trying to get a MSP430-based development board to talk to each other but simply don’t know where to start?

TI’s resources can be a hell to sort through. With all their documents (and software!!) creatively named something along the lines of SLAU0244 and SLAX00F, we can definitely see they’ve made their efforts to let developers find stuff easily. Read More…

 Scroll to top