Friday, July 04, 2008

It is Independence Day today in the US, and we’re in Washington, D.C. imageto see us some awesome fireworks!

Since today is July, 4th, and we are on Day 4 I figured it would be good to do a VSTT that dealt with numbers. The best one I know is how to display line numbers in Visual Studio:

Display Line Numbers:

Go to the Tools menu, then click on the Options… menu item. Find the Text Editor item in the list on the left. Then I recommend choosing All Languages. Next find and check the Line Numbers checkbox in the Display section on the right.

The image to the right will take you to a full size image if you want to see this in more detail.

Feedback:

Alright, we’ve more reader submitted tips.  Thanks guys. Yeah, we are now tied. score: Me 4 / Readers 4.

PowerPoint: 31 Days of Visual Studio 2008 Tips & Tricks.pptx (Note: PowerPoint is updated daily to include new items.)



Friday, July 04, 2008 10:18:00 (Eastern Standard Time, UTC-05:00)  #    Comments [2]  |  Trackback
Thursday, July 03, 2008

Oh, the humanity! How I hate it when I get “The terminal server has exceeded the maximum number of allowed connections.”

image

Page Brooks and I were just talking about how it only happens to you when you are in a bit of a hurry, and need to get something done ASAP. You are allowed two remote terminal sessions.

The problem usually isn’t that there are too many people logged in. The problem is almost always that people disconnected from their without ending their session or logging out. So terminal services thinks the connection is still active, but just idle.

One option is to use the Computer Management Console, and choose Action, Connect to another computer…, Services and Applications, and then go to Terminal Services Manager and log off or disconnect the sessions.

I found out about a more powerful command line version that was able to work for me. I think the above didn’t work because our servers are virtualized.

  1. run the following from a command prompt: query session /server:servername
  2. Next run the following: reset session [ID] /server:servername

Ah, it just works. So much better now. Me and our servers are friends again.



Thursday, July 03, 2008 14:22:00 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Monday, June 30, 2008

imageWe only have one more day left in our 30 days of .NET [Windows Mobile Applications]. Where do we go from here?

I’m really happy with the 30 Days of .NET so I do think I will continue that in one format or another for some time. It’s been a blast. And everyone knows my passion for Windows Mobile programming so we keep finding way to work that in there as well.

I haven’t quite decided what I’ll do for next month but I’m sure it’ll only get better as we move forward.

There have been a lot of request for applications that haven’t made it on deck yet, and obviously they aren’t all going to get done tomorrow. But I think I’ll be able to throw in some Bonus Day of .NET or Return of Day of .NET and knock some of them out over time.

My goal is to take all the existing content and clean it up some and make more through and detailed learning materials to really help beginners take off with Windows Mobile.

Hope you’ll join me on the road ahead…



Monday, June 30, 2008 01:10:00 (Eastern Standard Time, UTC-05:00)  #    Comments [1]  |  Trackback
Thursday, June 12, 2008

image

You know sometime someone tells you about something, and you can tell there is a whole lot more to it than they are telling you about. Well, signature capture for Windows Mobile is one of those things. It’s really not bad today and you can do it in one sitting easily now. But there was a time, when if your life depending on it you might be able to get it right. At least we have managed code now. A few of us attempted to do this feat in embedded Visual Basic years ago and I’m surprised it didn’t cost us our sanity. Oh the humanity…

You could do it you just had to copy each color pixel by pixel and save it into a bitmap, and that was a challenge too. And GetPixel() had to be the slowest function call ever. It took at least a second. No way, you were going to give someone a full screen to put there signature.

That was then, this is now…

image

Mobile Signature

Office 2007 might have 2007 features in it. And it works for Office 2007, well to a point. But with Windows Mobile applications less is more. Don’t get me wrong I really do think Mobile Signature would make a great feature in a more complete application. But as far as the feature of taking a signature on a mobile device this is a great approach.

Also note that Mobile Signature could be easily adapted into a drawing application, and so on, especially for kids.

Let’s talk about UI first. Notice how much space is dedicated to taking the user’s signature. This is important; I’ve seen almost the reverse before and that just isn’t very usable. I took a little extra time and care to make sure all control had a black border around them,expect the black color square. It has a gray border.

One thing to note is a wanted the user to be able to tell what color they would be writing in without having to draw on the screen. This is accomplished by having the borders around the active color flash on and off. This is a great visual effect that was easy to implement with a timer. We track the currently active color in a form level variable, and on the timer tick event, which happens every 500 ms, we toggle the visibility of the border around the active color. Works great! Check it out!

The menu is another area that is simple but you can learn from it. Save is very important to us, so it is prominent and has it own hardware button that can cause it to occur. On the menu we have an option for clearing the screen, showing the about form, and exiting the application. But we also have a menu option to change the size of the line we are drawing with. It can be set from any of the following: 1 pixel, 3 pixels, 5 pixels.

The core of the application is the code that actually draws the lines on the screen. Here it is:

   1: private void pictureBox_MouseMove(object sender, MouseEventArgs e)
   2: {
   3:     if (pen.Color != signatureColor)
   4:         pen = new Pen(signatureColor);
   5:  
   6:     if (pen.Width != width)
   7:         pen.Width = width;
   8:  
   9:     x1 = x2;
  10:     y1 = y2;
  11:     x2 = e.X;
  12:     y2 = e.Y;
  13:  
  14:     if (x1 == -1 && y1 == -1)
  15:         return;
  16:  
  17:     pictureBoxSignature.CreateGraphics().DrawLine(pen, x1, y1, x2, y2);
  18: }

 

One area of code that is worth checking out is the code to save the bitmap of the signature. It’s pretty advanced and powerful.

   1: // P/Invoke declaration
   2: [DllImport("coredll.dll")]
   3: public static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, uint dwRop);
   4:  
   5: const int SRCCOPY = 0x00CC0020;
   6:  
   7: private void Save(string filename, Graphics gx, Rectangle rect)
   8: {
   9:     Bitmap bmp = new Bitmap(rect.Width, rect.Height);
  10:     // Create compatible graphics
  11:     Graphics gxComp = Graphics.FromImage(bmp);
  12:     // Blit the image data
  13:     BitBlt(gxComp.GetHdc(), 0, 0, rect.Width, rect.Height, gx.GetHdc(), rect.Left, rect.Top, SRCCOPY);
  14:     bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Bmp);
  15:     // Cleanup
  16:     bmp.Dispose();
  17:     gxComp.Dispose();
  18: }

Everything else is pretty straight forward, but check it out and see what you think!

Download executable: mobileSignature.cab

Download Source Code: mobileSignature.zip

Feedback

So, how do you guys feel about line of business applications? Do you want more days that focus on line of business application topics? or less? Let me know! :D Tomorrow will be here before you know it.



Thursday, June 12, 2008 02:48:00 (Eastern Standard Time, UTC-05:00)  #    Comments [2]  |  Trackback
Monday, June 09, 2008

We have discussed the ability to assign an Windows Mobile application we have created to a device's hardware button. Once with our day two application, Bluetooth Manager, and once again with our day eight application, Rotate Me.

By default my device's buttons are configured as follows: "Button 1" starts "Internet Explorer", "Button 2" starts "Messaging", "Button 3" starts the "<Start Menu>", "Button 4" starts "<OK/Close>", and finally "Button 5" starts the "<Camera>". If you look at the screenshots below, you'll noticed I changed "Button 2" to start the "Rotate Me" application instead. This is the "as good as it gets" way to start an application; doesn't get better than one button press access.

Just in case everyone isn't aware of the feature in Windows Mobile, I've posted the steps here:

First click the "<Start Menu>", now click on "Settings" menu item, next click on the "Buttons" icon under the "Personal" tab, finally select a button and assign it a program. It's that easy.

image image image image



Monday, June 09, 2008 01:41:21 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Sunday, June 08, 2008

This is my favorite application so far. The concept is awesome. It takes the idea of a "sound effect keychain", and make it into a fully open and extensible mobile application.

image

Mobile FX

So if you are following me, then you know that if you press the birds button you'll hear a birds sound effect, and if you press the bomb button your hear a bomb sound effect, and son on down the list.

This application tries to be as much about form as it is function. All of the icon graphics are created with Axialis IconWorkshop. (Thanks for the heads up, Jamey!) It makes making really great icons a snap using its Image Object Packs. (See the image to the right for a small sample.)

image

What I really like about this application is there is the possibility of creating add-in sound packages. I'll discuss this more in a follow up blog posting to come soon. [If there is interest? Let me know.]

The way the application works is it looks for an XML file that tells it where each of its possible icons are and where the sound files for each icon are located as well. If you want to change the order of the icons on the screen just change the order of the "buttons" in the XML configuration file.

I haven't completed the extensibility point for others to add there own icons and sounds but that is a small enhancement which I'll do shortly.

 

 

 

 

 

 

 

 

Download executable: mobileFX.cab

Download Source Code: passwordGen.zip

Feedback:

How interested are you guys in the follow up article? Is this something you would enjoy? Would you like a second pack of sounds? Is this application something you would use? Would you create a sound pack of your own?



Sunday, June 08, 2008 02:52:33 (Eastern Standard Time, UTC-05:00)  #    Comments [2]  |  Trackback
Saturday, June 07, 2008

I had a couple submissions for ideas to use in today's application, but decided I would use one of my own. Friday night and all: girlfriends like to go out on Friday evenings, we need to go shopping, and later we want to watch a little TV together, so I didn't feel tonight was the best night for a big project.

My idea is a simple yet very useful application for generating random passwords.

image

Pocket PasswordGen

Nothing too fancy here. It's a good looking application, but it didn't take much to make it so. Just clean layout and simple design. I did add a horizontal ruler line between the inputs and the outputs. It is actually two panels set to 1 pixel high each with ones back color set to light blue and the other pure white. The form's background is just a little off-white to add some warmth, but it is hard to tell directly.

The application engine is also clean and simple. There is a password class that has properties for each of the options, and there are two methods: Generate, and ConvertToPhonetic.

I have four character groups:

     static string  lowerCase = @"abcdefghijklmnopqrstuvwyxz";
     static string upperCase = @"ABCDEFGHIJKLMNOPQRSTUVWYXZ";
     static string numbers = @"0123456789";
     static string punctuation = @"~!@#$%^&*()-+='"",.?";

Based on options the user chooses a character list is created with all possible characters for the user's password.

Next I Generate PasswordLength worth's of characters for the password.

This is very important. I use RNGCryptoServiceProvider to generate a random seed number for the random number generator. We want real random numbers, not wishy-washy random numbers. This is a good source for how to use Crypto providers to make a password generator.

Pretty cool code, so check it out if you haven't ever generated random numbers before.

I pulled the Phonetic Alphabet off Wikipedia and made it into a generic dictionary object.

Lastly, I added a menu item that allow users to copy the password to their clipboard. I had to write some code to copy text into the clipboard. This is the best code I could find for doing so.

BTW, there is a bug in the above screenshot. Fixed in the current release. Can you see it? It's subtle. It has to do with the handle the last character. Good luck finding it.

Download executable: passwordGen.cab

Download Source Code: passwordGen.zip

Feedback

Nothing but positive feedback so far. I really appreciate. It seems we are off to a good start. Still I have another 24 days left, and only a handful of ideas I really like. So don't keep that good idea to yourself. One comment on the blog and you might have yourself your first Windows Mobile custom application.



Saturday, June 07, 2008 01:35:45 (Eastern Standard Time, UTC-05:00)  #    Comments [5]  |  Trackback
Wednesday, May 21, 2008

image

http://www.tcspromo.com/developercontest/

You could WIN $25,000 and a Mobile Game Developer Contract.

The AT&T Developer Program, devCentral, has partnered with Windows Mobile, HTC and mobile game distributor, I-play, to bring you the AT&T Game Development Contest for Windows Mobile. Show us what you've got and have the chance to win $25,000 cash and a distribution contract. Other prizes include $5,000 cash for runners-up.

Key Dates

  • Deadline for submission: July 31st, 2008, 12 am (EST)
  • Winner announcement at CTIA in San Francisco: September 10-12, 2008

 

PRIZES:
ONE (1) GRAND PRIZE: The Grand Prize Winner will receive:
a. the opportunity for a mobile game distribution contract with I-play on I-play's standard terms (subject to the game meeting I-play's quality assurance requirements; any distribution is subject to the conclusion of a standard publishing and distribution agreement between I-play and grand prize winner);
b. the opportunity for placement (as determined by Sponsor) of game on the games portal on AT&T Media Mall, subject to Sponsor's determination of appropriateness in its discretion;
c. $25,000 (US);
d. a trip for winner and guest to the CTIA conference in San Francisco (September 10-12, 2008);
e. the announcement and recognition of Grand Prize Winner at the CTIA conference;
f. passes for winner and guest to PDC;
g. security and certification signing waivers;
h. an HTC Mobile Phone
The total approximate retail value ("ARV") of Grand Prize is $30,000, depending on location of winner's residence, departure times and any airfare fluctuations.
TWO (2) FINALIST PRIZES: The remaining two (2) finalists will each receive:
a. $5,000 (US);
b. a trip for runner-up and guest to the CTIA in San Francisco (September 10-12, 2008);
c. passes for runner-up and guest to PDC;
d. security and certification signing waivers;
e. an HTC Mobile Phone
The ARV of each Finalist Prize is $10,000, depending on location of winner's residence, departure times and any airfare fluctuations.
Trip for Grand Prize Winner and each Finalist Prize consists of: round-trip, economy-class air transportation for two (2) between the major airport with regularly scheduled flights closest to the winner's permanent residence (as determined by Sponsor in its sole discretion) and San Francisco, CA; (b) two (2) nights standard hotel accommodations (one double occupancy room and room tax only) in San Francisco area; (c) ground transportation to/from hotel and airport. Ground transportation may be provided in lieu of air travel if winner resides within 100 miles of San Francisco, CA. If winner is a resident of a jurisdiction that deems him/her to be a minor, parent/legal guardian must travel as the allotted guest. If guest is a resident of a jurisdiction that deems him/her to be a minor, he/she must be accompanied by his/her parent/legal guardian, and such person must pay his/her own expenses unless he or she is the winner. Winner and guest must travel on same itinerary on dates to be designated by Sponsor. All incidental expenses and taxes not specified herein will be the sole responsibility of the winner and his/her travel companion, including without limitation other ground transportation, food, and beverages. Winner and guest will be responsible for all applicable travel and other insurance, all applicable airport charges including without limitation, any excess baggage charges, airport taxes, and tickets are not transferable, refundable or redeemable. Sponsor will not replace any lost or stolen tickets, travel vouchers or certificates. Once booked, no change, extension, or substitution of trip dates is permitted, except by Sponsor at its sole discretion. If the CTIA conference is postponed or canceled, remainder of prize will be awarded as total prize.
Ten (10) SEMI-FINALIST PRIZES:
a. Entry into Microsoft WM Beta Developer Program;
b. WM Certification Waivers
The ARV of each Semi-Finalist Prize is $500.


Wednesday, May 21, 2008 03:00:52 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Wednesday, April 09, 2008

imageIt's almost that time. What time is it you ask? Well, it's only 4 days, 02 hours, 20 minutes, and 22 seconds left until this year's Microsoft Most Valuable Professional Global Summit.

And the best part, at least for me :D, is that'll I'll be going this year. I can't wait to meet all the other MVP's, and to get to hang out with some of my developer friends that I don't get to see nearly enough.

This year's conference looks to be really exciting. I'm expecting some big news to come out of Redmond next week.

And I was able to find a great "utility" to help me keep track of when the conference starts: :D

Windows Vista "MVP Global Summit Countdown" Sidebar Gadget



cool | INETA | miscellaneous | MVP | personal | windows
Wednesday, April 09, 2008 16:49:28 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Tuesday, April 08, 2008

imageAbout a dozen of us are getting up early tomorrow, leaving at 4:30am, to ride up to Charlotte, NC to attend the Windows Server 2008, Visual Studio 2008, and SQL Server 2008 launch event there.

Not only do you get to attend a great event hosted by Microsoft for free. But you'll also get to take home a promotional kit with versions of all three products.

You should definitely make a point of attending one of the launch events in your area!

http://www.heroeshappenhere.com/

I'll try and twitter updates from the event live tomorrow: http://twitter.com/CJCraft



Tuesday, April 08, 2008 03:00:48 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Monday, April 07, 2008

Due to the scheduling conflict with the Heroes Happen Here Event in Charlotte, the April PDANUG Event has been moved to April 29th, 2008.  More details to follow.  See you all in Charlotte tomorrow!


imageTuesday, April 29th, 2008
Chris Reeder, Chris Craft, and Page Brooks

Topic:
SQL Server 2008, Windows Server 2008, and Visual Studio 2008 (Respectively)

Tuesday, April 29th, 2008, is the next meeting of the Pee Dee Area .NET User Group.

Chris Reeder, Chris Craft, and Page Brooks will be presenting on the latest exciting new products from Microsoft.  First, Chris Reeder will give us a run down on a few cool features in SQL Server 2008.  Next, Chris Craft will take us on a tour of some excellent new features in Internet Information Services 7 (IIS7).  Page Brooks will finish off the presentation with a few cool tips and tricks in Visual Studio 2008.

Please click the link below to register.  We use this information to determine how much food to buy!

Here is the tentative schedule:
6:00 PM - 6:20 PM Socializing / Free Dinner
6:20 PM - 6:30 PM Introduction, Sponsor Time, and News.
6:30 PM - 8:00 PM Presentations



Monday, April 07, 2008 03:00:08 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Sunday, April 06, 2008

image"The  Census Bureau will tell a House panel today that it will drop plans to use handheld computers to help count Americans for the 2010 census, increasing the cost for the decennial census by as much as $3 billion, according to testimony the Commerce Department secretary plans to give this afternoon."

[That means the cost increased by around $8/person to count, and classify, each of us with a paper-based census.]

HTC Census Phone Specifications:

  • Dual-band CDMA/EV-DO device
  • WiFi; Phone Connector; miniUSB; Bluetooth
  • No microphone or speakerphone built-in
  • 6.1 x 3.1 x 1.4 inches (154 x 79 x 29 mm); 12.3 oz (350 g)
  • QVGA touch display (240x320); 3.5 Inches
  • imageimageWindows Mobile 5 OS for PPC
  • Intel Bulverde 416MHz processor
  • GPS with Sirf Star III chip [neat to way to verify and monitor census enumerators, mashups possibilities would have been awesome]
  • SD slot for memory
  • Fingerprint reader [I'm guessing this is for data security?]
  • Data connection only device [device does not allow voice calls, only data transmissions]

How Much is a Billion? [from about.com]

  • If we wanted to pay down a billion dollars of the US debt, paying one dollar a second, it would take 31 years, 259 days, 1 hour, 46 minutes, and 40 seconds.
  • A tightly-packed stack of new $1,000 bills totaling $1 billion would be 63 miles high. In comparison, jet planes fly at 30,000 - 40,000 feet (5.7 - 7.7 miles high).
  • About a billion minutes ago, the Roman Empire was in full swing. (One billion minutes is about 1,900 years.)
  • About a billion hours ago, we were living in the Stone Age. (One billion hours is about 114,000 years.)
  • About a billion months ago, dinosaurs walked the earth. (One billion months is about 82 million years.)
  • A billion inches is 15,783 miles, more than halfway around the earth (circumference).
  • The earth is about 8,000 miles wide (diameter), and the sun is about 800,000 miles wide, not quite a million.

Total cost of the 2010 census to between $13.7 billion and $14.5 billion [from nextgen.com]

"Gutierrez said reverting to a paper-based census, in addition to other costs not associated with the handhelds, is expected to increase the cost of the 2010 census to between $2.2 billion and $3 billion through fiscal year 2013. That would bring the total cost of the 2010 census to between $13.7 billion and $14.5 billion. He said the bureau would need an increase of $160 million to $230 million for fiscal 2008 to cover costs associated with returning to paper, with an additional $600 million to $700 million for fiscal 2009. Gutierrez added that the majority of the cost increases would occur in 2010."

[So it actually costs somewhere around $37/person to count and classify each of us, or around 7 hours of minimum-wage labor.]

[It looks like the made the right choices: they tested years in advance, and when they knew they couldn't add the new 400 requirements, and meet their deadline. So they decided stopped the project. There are worse endings a project can have.]

[I wonder if the "Real ID Act" is meant to handle the Census as well.]

[I was pretty excited when I first heard about this projects goal of mobilizing the US Census, especially when I learned it would be done using Windows Mobile devices. I'm not surprised the project was ended considering the development team was faced with 400 new requirements this late in the game, with an already booked schedule. The US Census is used for many, many demographic and statistical tasks. We do a lot more than simple count the number of Americans. And I think that is the challenge, that stopped the project from making it to the finish line. Big government, requires big software, which is hard to do on small devices.]



Sunday, April 06, 2008 03:00:45 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
image

Sunday, April 06, 2008 03:00:17 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Friday, April 04, 2008

Growing up I always loved Mad Magazine, and one of my favorite parts were all the Mad Fold-Ins, in the back of the magazine, that Al Jaffee created.

The New York Times has a special online article that has many interactive Mad Magazine Fold-Ins on topics ranging from Presidents, War and the Military, Pop Culture,  to Sports.

Fold-Ins, Past and Present - The New York Times

image

image



Friday, April 04, 2008 03:00:39 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback

imageDuring my "Welcome to the World of Windows Mobile" presentation at the Atlanta Code Camp 2008 I used Remote Display for Windows CE to allow the attendees to see my device, on my desktop, on the presentation screen. After my talk was over, a few people from the audience approached me, and asked me how I was able to run Remote Display on Vista, and connect with it to my Windows Mobile 6 device.

They told me they had tried to do the same thing, but all they ever got was a "the OS or CPU of this device is unknown to this application" error. I explained that this wasn't due to Vista, but actually was caused by a missing file on most newer Windows Mobile devices.

In order to use Remote Display the first thing you will need to do is download the Windows Mobile Developer Power Toys, and install the ActiveSync Remote Display application.

Windows Mobile Developer Power Toys

ActiveSync Remote Display - Display Pocket PC applications on your desktop or laptop without needing any device side configuration.

Work Around:

Copy the cerdisp2.exe file from the desktop's "\Windows Mobile Developer Power Toys\ActiveSync_Remote_Display\Devices\wce400\armv4\" folder, and paste it into the device's "\windows" folder of your Windows Mobile device.



Friday, April 04, 2008 03:00:06 (Eastern Standard Time, UTC-05:00)  #    Comments [1]  |  Trackback
Thursday, April 03, 2008

By default, Outlook does not show holidays on the calendar. If you would like to have holidays show in Outlook 2007, you can do the following quick steps:

  1. imageOpen Outlook 2007.
  2. From the tools menu, click Options.
  3. Click the Calendar Options... button.
  4. Click the Add Holidays... button.
  5. Place a check beside any appropriate locations.
  6. Click OK.
  7. Click OK to close the Calendar Options dialog box.
  8. Click OK to close the Options dialog box.


Thursday, April 03, 2008 03:00:49 (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback
Monday, January 14, 2008
image

Ars Technica has a great article on something new developing at Yahoo.

From the sound of it, Yahoo Mobile Developer Platform may be a lot like what many are expecting from Apple's iPhone SDK. Developers will be able to write a single mini-application that will be made available through Yahoo's Widget Gallery, where users can cherry-pick their favorite widgets to use on their phones. There are already a handful of widgets available from big names like MySpace, MTV, and eBay, and Yahoo said that a full SDK with guidelines would be available "soon."

Yahoo! Mobile Developer Platform

Yahoo! Mobile Developer Home

Yahoo! Mobile Developer Blog

Hopefully this will encourage Microsoft to release SideShow for Windows Mobile, before someone else does it first.