CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Paul Laudeman

Helping You to Make "Smart Clients" Smarter!

April 2005 - Posts

  • Looking to Master Rich Client apps?

    Wintellect will be holding a 4-day Mastering Rich Client Applications using Windows Forms class with Jason Clark in Atlanta, GA on June 7th – 10th:

    This in-depth class teaches the design and use of the Windows Forms classes in the .NET Framework class library. You will learn the core architecture of this layered API, as well as skills for applying the tools in daily practice. This course covers the ins-and-outs of Windows Forms, starting with the basics, and leading up to the development of your own custom extensions.  The class will be held at Peachtree, a subsidiary of Best Software at 1505 Pavilion Place in Norcross, Georgia 30093.

    For more information, contact Todd Baxter.

    [tag:smart clients,wintellect] 

  • Commerce Server 2002 Security Resources

    Here are some resources to learning more about Commerce Server 2002 security and related topics:

    Securing Your Commerce Server 2002 Site
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csvr2002/htm/cs_top_securing_bsne.asp

    Deploying a Secure Commerce Server 2002 Site
    http://www.microsoft.com/technet/prodtechnol/comm/comm2002/deploy/seccncpt.mspx

    Commerce Server 2002 Technical Overview
    http://download.microsoft.com/documents/uk/windowsserversystem/commerceserver/commerce-server-2002-technical-overview.doc

    Microsoft Commerce Server web site
    http://www.microsoft.com/commerceserver/

    Additional TechNet Resources
    http://www.microsoft.com/technet/prodtechnol/Comm/comm2002/default.mspx

    If I have missed any, please let me know!

    Technorati Tags: ,  

  • Getting started with Compact Framework development on Windows CE

    I've recently started development work with the Compact Framework on a Windows CE mobile device by LXE. I've had the opportunity to dabble a bit before with CF development, but this is the first time I've been tasked with building anything more than the classic 'hello world' type of application. The application I'm building will read RFID tags and scan bar codes, smooth the data with the help of a Java-based server, and send it on for further processing to back end data systems. How cool is that!

    The device I am using is the LXE MX3X, a rugged and sturdy portable device that comes with an RFID and bar code scanner built in to the device. For any one else who may be interested in building applications on this device, following are some of the resources that helped get me going.

    Development Environment 

    Visual Studio Pre-Req's

    NOTE: Select ARMV4T as the processor type for deployment/debugging
    by running the SelectWinCECPU tool in your WinCE Utilities directory

    Additional Tools

    LEX MX3X Resources

    Technorati Tags: , , ,
  • Microsoft Virtual PC Tip - Using the Microsoft Loopback Adapter

    Microsoft Windows 2000 and XP (and probably others) ship with a built-in network interface driver called the "Microsoft Loopback Adapter" that lets you create a local-only network interface device. This adapter can be extremely useful when you are doing development testing using Virtual PC and want to isolate your Virtual PC's from your main network.

    For instance, let's say that you want to test a SharePoint Portal configuration with a separate front end web server, a separate index and job server, and a separate database server. Using Virtual PC you would configure the network adapter of your virtual machine to use the Microsoft Loopback Adapter for each virtual machine in your virtual server farm. When you spin up all of your virtual machine instances, they would only be able to communicate among themselves and any traffic would be isolated and limited to your testing environment.

    To configure your Microsoft Loopback Adapter under Windows XP, do the following:

    1. From the Control Panel, select "Add Hardware"
    2. Select "Yes, I have already connected the hardware"
    3. Select "Add a new hardware device" (at the bottom of the listbox)
    4. Select "Install the hardware that I manually select from a list (Advanced)"
    5. Select "Network adapters"
    6. Select "Microsoft" as the manufacturer and "Microsoft Loopback Adapter" as the adapter

    From within Virtual PC

    1. Select your virtual machine
    2. Go to the Settings (either right-click the VM and select "Settings" or from within a running instance go to the "Edit" menu and select "Settings)
    3. Click the "Networking" setting
    4. For your network adapter, select "Microsoft Loopback Adapter"

    Now, you should be able to see your other running Virtual PC instances that also share the same loopback adapter!

    Note: If you run into a problem where you can't select the Microsoft Loopback Adapter", you'll need to verify that 1) the "Virtual Machine Networking Services" are installed for the loopback adapter, and 2) if they are, and you still can't select the adapter, uninstall the service and then reinstall the service (by pointing to the Virtual PC installation directory under Utility/VMNetSrv).

    Happy Virtual PC'ing!

    Technorati Tags:      

  • Windows Forms - Basic events in the Lifecycle of Forms and Controls

    Recently, a community member posted a question to the WindowsForms.NET site forums asking about the basic events that are fired in Forms and User Controls in Windows Forms applications. After digging through the MSDN documentation and various other sources (amazingly, it doesn't seem like the complete list is documented in any one place), I came up with the following:

    Form Events:

    • Construtor
    • Load
    • Layout
    • Activated
    • Paint­
    • Closing
    • Closed
    • Deactivate
    • Dispose

    and for Controls:

    • Enter 
    • GotFocus 
    • Leave 
    • Validating 
    • Validated 
    • LostFocus

    I also discovered a code sample called EventSpy written by Urs Eichmann that you can use to view and filter the events to see in real time to see how your application is behaving. This is really helpful to use as you can see which events are fired and in what order as your application runs. Very cool!

    Technorati Tags: ,  

  • Virtual PC 2004 hotfix available for suspend/resume from hibernation problem

    Microsoft has made a hotfix available for Virutal PC 2004 (post SP1) that fixes a bug that occurs when you leave a VirtualPC instance running, suspend your system, resume your system, and can no longer interact with the VirtualPC guest.

    KB889677 - Describes the problem when the computer resumes from hibernation, Virtual PC 2004 stops responding temporarily.

    Special thanks to Ben (Virtual PC Guy) for helping to get this fix out!

    Technorati Tags:  

  • WeProgram.NET (Newport News, VA) users group meeting tonight!

    Guest speaker Andrew Duthie (Microsoft's Developer Evangelist for the mid-atlantic) will be giving a presentation on the Security Block of Enterprise Library:

    The Microsoft Enterprise Library Security Application Block, version 1.0, helps developers implement common security-related functionality in their applications. Applications can use the application block in a variety of situations, such as authenticating and authorizing users against a database, retrieving role and profile information, and caching user profile information. The Security Application Block has the following features:

    • It reduces the requirement to write boilerplate code to perform standard tasks.
    • It helps maintain consistent security practices, both within an application and across the enterprise.
    • It eases the learning curve for developers by using a consistent architectural model across the various areas of functionality provided.
    • It provides implementations that you can use to solve common application security problems.
    • It is extensible; it supports custom implementations of security providers.

    If you have not heard Andrew speak before, I highly recommed it. He's a great presenter and the material he is presenting is, as I understand it, brand new so it should be very interesting! (For more information about the Security Block, check out the webcast, slides, and hands-on lab over at p&p live.)

    If that's not enough, we will also be giving away one free license to ReSharper - a developer IDE plug-in for Visual Studio .NET and C#!

    For more details and directions to our meeting, please visit the WeProgram.NET web site! See you there!

  • Stress testing SharePoint Portal Server 2003 tips

    James Edelen has a great post on the steps to take in order to stress test a SharePoint Portal Server 2003 web site. We recently wrapped up development for our internal SharePoint Portal server project and performed much the same steps as did James, but we added some additional performance counters to our Microsoft ACT scripts. The benefit to adding performance counters in addition to just running tests against your site is that you can see how the server is performing under stress.

    If you notice that any of your counters are abnormally high under your target loads, you can take steps to identify what the cause of the extra load is, and hopefully, tweak your configuration or code to bring the counters back down to acceptable levels while boosting your overall requests per second throughput. Microsoft has published several whitepapers (see the Microsoft Solution Accelerator for Intranets) that will help you identify which counters to use, what numbers to look for when testing (both in terms of overall request per second serviced by your application and counter numbers from your system), and how to scale up and/or scale out your SharePoint server farm to meet the demands of your users.

    To add performance counters to your Microsoft ACT stress tests, right-click your defind test script, select Properties, click the Counters tab, define your collection interval (the default 10 seconds is good), and then add the performance counters you are interested in monitoring. After your tests complete, Microsoft ACT will add the performance counters you monitored along with the other information collected in reports.

    Microsoft recommends that you monitor at least the following counters when stress testing SharePoint:

    • ASP.NET Apps: Requests/Sec (for your SharePoint site)
    • Logical Disk: % idle time
    • Logical Disk: Avg. Disk Queue Length
    • Memory: Available MBytes
    • Network Interface: Bytes Total/sec
    • Paging File: % Usage
    • Paging File: % Usage
    • Processor: % Processor Time
    • System: Context Switches/sec
    • System: Processor Queue Length

    TIP: To visually compare different tests runs to each other, just check the checkboxes in the report list for the test runs you are interested in comparing. Retaining test results for multiple runs over time allows you to analyze and compare server performance as your server grows or under conditions that might seem to indicate a problem with the performance of your server.

    Final Thoughts

    • Define your performance goals at the same time you are defining the requirements for your application.
    • Get a good sense of the number of users who will be accessing your application, what their expectations are in terms of page performance and responsiveness, and how they will be accessing your site (broadband, vpn, dialup, etc.). Plan for future growth that is aligned with the growth of your business.
    • Test your site throughout the development cycle to ensure that you are at least meeting and hopefully(!) exceeding your original goals.
    • Create tests that simulate real user behavior on your portal site. Define the common paths and actions that users will take and script your tests around those behaviors.

    Additional Resources

    Technorati Tags: , ,
  • Getting Started with Enterprise Library!

    Recently we had the need to implement a more standardized way of logging information and handling exceptions in our SharePoint Portal webparts. In previous applications, we have used the various Microsoft Application Blocks and other tools (such as log4net) for our needs. If you haven’t heard yet, the “Enterprise Library” is the next generation of Microsoft's Application Blocks featuring new enhancements and improvements based on community feedback.

    This past weekend I finally had the opportunity to sit down and spend some time with the library by integrating it into a simple application I came up with to demonstrate the various new blocks. My sample Windows Forms application used the Caching, Configuration, Data, Exception Handling, and Logging blocks. While the application itself was a bit contrived (consisting of a single form that displayed a bunch of Northwind customers in a grid), the actual implementation of the blocks was done to satisfy real world needs (exception handling, logging, diagnostics, etc.). (If there is any interest, I can link to the demo project.)

    Based on my experiences so far, here are my favorite features of the new library:

    • Consistent configuration experience across all blocks. Each block can be used separately or combined with one another in complimentary ways.
    • Highly configurable. If you’re using the logging block, for example, you can specify sinks (destinations) of where you want your logs to go. Out of the box you can specify the event log (the default), email, flat files, MSMQ, or WMI. 
    • Shipped with unit tests! In the past I’ve modified the behavior of some of the blocks but lacked the means necessary to regression test my changes. Now with the unit tests shipping as part of the default install, I can be more confident that any changes I make won’t break existing code.
    • Consistent experience performing common tasks between Windows Forms and ASP.NET. Using the Enterprise Library blocks allows me to program against the same API no matter if I'm building a Windows Forms apps or ASP.NET apps. For example, I can easily take advantage of caching now on both  smart clients and ASP.NET -- before I had to roll my own cache engine for a Windows app or reference the caching framework of ASP.NET directly (yuck!).

    Here are some tips to get you started:

    • Make sure you run the install script after completing the setup to install the additional WMI support and other performance counters for the blocks themselves (click the “Install Services” link in the program group folder).
    • Spend some time looking through the docs that ship with the product to get yourself acquainted with what all the Enterprise Library blocks have to offer — don’t be intimidated by the configuration interface and all the XML configuration files (psst, it’s a lot easier to set up and use than it looks!).
    • You don’t need to rip and replace existing code that uses the older version of the application blocks — start looking for opportunities to use the new library blocks in your new projects where it makes sense.

    …and some more resources:

    • See Channel 9 for an Enterprise Library Wiki with links to resources to help get you started
    • Ron Jacobs, Product Manager for p&p, has quite a few links of interest on his website at www.ronjacobs.com including links to webcasts and hands-on labs that you can download. (For some extra entertainment, be sure to check out his podcasts!)
    • Fellow CodeBetter blogger Mark Digiovanni presented recently on Enterprise Library featuring a custom data provider to interface with VistaDB (link).
    • Be sure to check out the Rolling File Sink for the logging block, shipped separately, that allows you to have fine grained control on how your logs are managed.
    • Check out these bloggers from the patterns & practices group: Ron Jacobs, Scott Densmore, and Tom Hollander (wow, what a crew! where can I sign up?)
    • Enterprise Library Workspace on GotDotNet where you can download the latest releases and participate in the community around these blocks

    and finally!

    • Start thinking about how to implement these blocks from the outset of your project! By learning about these blocks and implementing them from day one, you will give yourself a solid foundation to upon which you can confidently build your application — rather than worrying about if you should have done it when you’re at the end of your dev cycle and then wonder how you can do it at the eleventh hour before you ship.
    Technorati Tags:
More Posts

Our Sponsors

Free Tech Publications