Archive for the ‘CodeProject’ Category.

Writing a tftp server windows service

For an actual project I needed a tftp server service for a Windows 2003 server. I looked around in internet and only found tftp servers running in user space, no real windows service. So I searched for source code applications I could use and found tftpUtil at sourceforge.net (http://sourceforge.net/projects/tftputil/). Although the short description states it would implement a service, it does not in reality. But the tftpUtil class was more or less easy to use and so I started to write a service ‘wrapper’ around it.

        protected override void OnStart(string[] args)
        {
            AddLog("OnStart entered...");
            StartTFTPServer();
...
        }

Continue reading ‘Writing a tftp server windows service’ »

Mobile Development: Easy to use background thread with GUI update

Although there are well know ways to update the GUI from a background thread not running in the GUI thread, I looked for an easiest to use solution. After some experiments I got a background thread class that is very easy to use. No BeginInvoke or Control.Invoke needed any more to update a GUI element.

The final solution uses a MessageWindow inside a control based class with a worker thread. As the control and the MessageWindow is part of the GUI thread, there is no need to use Invokes.

Inside the thread I use SendMessage to transfer background thread informations to the control, which then fires an event you can subscribe in the GUI thread.

The test app attached shows three threads running independently and all update the GUI frequently without blocking the GUI.


Here is my try to visualize my idea and solution

Continue reading ‘Mobile Development: Easy to use background thread with GUI update’ »

Transmit data from WinMo device to PC: SocketWedge and SocketSend

Although you may find this combination useless, here is something that will transmit data from a Windows Mobile device to a PC and the PC will type (like a barcode scanner keyboard wedge) the transmitted data.

The workflow theory is:

  1. You scan a barcode or RFID TAG and the data is wedged into the SocketSend input textbox or you type some text into the textbox.
  2. You connect your mobile device to the network, where you have a Windows PC running SocketWedge.
  3. On the mobile within SocketSend you tap the transmit button and the data is send to SocketWedge.
  4. SocketWedge receives the data and puts it in the keyboard message queue of a defined application.
  5. The data is typed into the target application.

Continue reading ‘Transmit data from WinMo device to PC: SocketWedge and SocketSend’ »

Windows CE and Mobile SetupDll with unzip support

SetupDll_Zip

Update 14. sept 2010: fixed source code and template files, please use the new files only

Create windows ce cab files which install a complete directory structure onto a device. I created
this small tool, as I needed an easy to use tool to create a pseudo installation cab.

The DLL will unzip a archiv file with all dirs onto a device. To build a new cab use the directory
structure you will find below cabdir.

Continue reading ‘Windows CE and Mobile SetupDll with unzip support’ »