New year – new blog or how to migrate Community Server to any other engine, supports XML-RPC

יום חמישי, ינואר 1, 2009

Please update your bookmarks, because the new url of this blog is (you have not update RSS feeds, it will be done automatically). Why I did it? Why I decided to go to “stand-alone”… Well. there are some reasons. Generally, I do not want to explain all those here, but trust me, there are some. The main reason is, that there is no responsible person in charge for this blog platform in Microsoft Israel. This why, if your blog is popular and you have a respect to your blog visitors, you cannot host it here… Take a look...

Read and use FM radio (or any other USB HID device) from C#

יום שלישי, דצמבר 30, 2008

Last time we spoke about reading and decoding RDS information from FM receivers. Also we already know how to stream sound from DirectSound compatible devices. However, before we can do it, we should be able to “speak” with such devices. So, today we’ll spoke about detection and reading information from Radio USB adapters (actually from any Human Input Devices). Let’s start. First, if you want to do it, go and buy such device. The are not a...

Capturing and streaming sound by using DirectSound with C#

יום חמישי, דצמבר 25, 2008

I already wrote a little about managed way to use DirectX DirectSound. Today we’ll speak about how to get sound from your microphone or any other DirectSound capturing device (such as FM receiver) and stream it out to your PC speakers and any other DirectSound Output device. So, let’s start creating our first echo service by using managed DirectX. First of all we should decide what Wave format we want to use for capturing and recording. So,...

Quick Silverlight (and WPF) tip: How to write program without XAML

יום שלישי, דצמבר 23, 2008

From the moment, 10K MIX09 contest was launched, I got more, then 20 people, asking the same question: Is it possible to have Silverlight program up and running without XAML at all? The answer is “YES, IT IS”. Here is how: All you need for run WPF or Silverlight application is Class inherited from System.Windows.Application Class inherited from System.Windows.Controls.UserControl So, Let’s create new WPF or Silverlight...
אין תגובות

Reading and decoding RDS (Radio Data System) in C#

יום שישי, דצמבר 12, 2008

RDS or Radio Data System is very common in US and many European countries. It is communication protocol used to send small amount of digital information using regular FM radio broadcast. This protocol is used to "tell" your receiver about alternative frequencies, time, program notifications, program types, traffic information and regular text (such as singer name or genre). Unfortunately in Israel RDS is not very common and there is very limited number of radio stations broadcasts RDS information. ...
אין תגובות

Creating transparent buttons, panels and other control with Compact Framework and putting one into other

יום שישי, נובמבר 21, 2008

In WPF/Silverlight world it's very simple to make transparent controls and put anything inside anything. However, that's not the situation in WinForms, and even worth in the world of compact devices with CF. Within this worlds, there is only one way to make controls transparent - to use color masks. Today, we'll create transparent controls with Compact Framework and put it into panel, which has image background. So let's start. First of all, we need create our own control....
אין תגובות

How to P/Invoke VarArgs (variable arguments) in C#? … or hidden junk in CLR

יום רביעי, נובמבר 19, 2008

Recently I wrote a cheat sheet for pinvoking in .NET. Shortly after I got a question in comments about how to deal with variable arguments, when it's more, then one parameter. Also what to do if those arguments are heterogeneous? Let's say, that we have following method in C: int VarSum(int nargs, ...){    va_list argp;    va_start( argp, nargs );    int sum = 0;    for( int i = 0 ; i < nargs; i++ ) {        int arg = va_arg(...
אין תגובות

Auto scroll ListBox in WPF

יום שני, נובמבר 10, 2008

In WinForms era it was very simple to autoscroll listbox content in order to select last or newly added item. It become a bit complicated in WPF. However, complicated does not mean impossible. As for me, Microsoft should add this feature to base ListBox implementation as another attempt to be attractive environment for LOB application. See, for example this thread from MSDN forums. I'm really understand this guy. He do not want to implement it with a lot...
תגובה אחת

Programming for Windows 7

יום ראשון, נובמבר 9, 2008

Well, Windows 7 is going to be released by the end of next year. This is great news, because it seemed, that Microsoft finally understand how to get the best of Windows Vista and make it to work not only on monster machines. It even works on new brandy my wife's pinky machine. And if it works there and my wife is happy with it, this OS going to be very impressive. But from the other...

P/Invoke cheat sheet

יום שני, אוקטובר 20, 2008

I’m working a lot with p/invoke, and know how it’s hard to produce correct signature for unmanaged method. So, today I decided to publish basic cheat sheet for methods, parameters and attributes you should use in order to invoke unmanaged methods from managed code without a lot of problems. We start with data type translations. Here the table to understand it. Data type from unmanaged signature ...