Friday, April 24, 2009

What is the MVP Program?

Have you ever wondered what the Microsoft MVP program is about or how MVPs are selected? Toby Richards, who runs the MVP program at Microsoft, talks about. http://cli.gs/9MU5Hr


Three Strikes and I'm Out

Speaking a conferences is a very time consuming prospect. You need to put great effort into the material to ensure it matches the expectations of the audience. Code needs to be tested. And then there are the practice sessions, preferable in front of a live audience.

But conference preparation starts long before any of that. You need to first come up with several topics because conference organizers generally ask potential speakers for more than one topic. A catchy title helps. Several years ago, I had one called "OOP, I Did it Again", that was an introduction to Object Oriented Programming. You then have to come up with a description, bullet points that hit the highlights of the presentation, figure out if it's a 100, 200, 300, or 400 level talk, and what pre-requisites are needed. Then, you need to put your proposal into the format needed by the conference organizers. So, by the time you've done this for three or four topics, you have easily spent several hours.

For the past three years, I've done this for Southwest Fox, but have not been accepted as a speaker there. So, I've decided to no longer submit proposals for the conference. I have no doubt there will be great presentations and it will be a fantastic conference, but it's no longer an effective use of my time.

I probably won't be there as an attendee either. My company has no training budget this year and it really is cost prohibitive for me to foot the bill myself.

I wish the Rick, Doug, and Tamar all the best for this year?s Southwest Fox and for many years to come.


Tuesday, April 21, 2009

Functions and Procedures in VFP 101

When working in Visual FoxPro, functions are procedures are almost the same thing. Look at the following code:

FUNCTION DoSomething
LPARAMETERS Param1, Param2
? "Param 1= " + Param1
? "Param 2= " + Param2

PROCEDURE DoSomethingElse
LPARAMETERS Param1, Param2
? "Param 1= " + Param1
? "Param 2= " + Param2

The function and procedure are actually identical. The difference to determine whether you have a function or procedure is not how they are defined, but how they are called. You can even call them the same way.

DO DoSomething WITH "Hello", "Procedure"

DoSomething("Hello", "Procedure")

You'll notice that DoSomething was defined as a procedure, but we can call it as either a procedure or a function. We can do the same thing with DoSomethingElse.

The difference is how the parameters are passed. When called as a procedure, the parameters are passed by reference. When called as a function, the parameters are passed by value. You can change how they?re passed in a function with SET UDFPARMS TO REFERENCE but you can?t change how parameters are passed when calling the routine as a procedure.

So, which should you use? I think you should always call the routine as a function because the routine cannot accidently change the value of the parameter. This is the kind of nasty side effect that can be difficult to track down.

Labels:


Tuesday, April 07, 2009

Two Microsoft Events Coming to Salt Lake City

Microsoft has scheduled two events in Salt Lake City in May.

The first is XAMLFest, coming up on May 1
Are you excited about the WPF but concerned about the learning curve? Have you seen Silverlight but don’t know where to get started? Or are you curious about how tools like Visual Studio and Expression Blend help designers and developers work together to deliver great user experiences? If so, join us at XamlFest! XamlFest is an interactive event where you’ll learn about the platforms, tools, and processes used to deliver differentiated user experiences. It’s a chance for you to mingle with UX-minded Microsoft folks. To register, please send an e-mail with the names and e-mail addresses of your attendees to xamlfest-slc@live.com. Come as you are - leave xamlized!

The second is MDSN Unleashed Presents: The Best of MIX is scheduled for May 6. It will be three different topics offered in two sessions. You only need to sign up for one session and get all three topics for the price of one!

What’s New in Silverlight 3?
Are you interested in building business-focused Rich Internet Applications (RIAs)? Would you like to take advantage of 3D in the browser, but assume it is too hard? Have you wanted to take a Silverlight application offline? Then this session is for you. We will explore and illustrate the new features of Silverlight 3, including the following:

Building Web Applications with Windows Azure
This session will begin with a brief overview of Azure and discuss some of the announcements made at MIX. We will then illustrate through demo how to build a Windows Azure application from the ground up. We will illustrate how to consume Azure Table Storage, how to host services, web pages and Silverlight components, as well as how to deploy your solution to the cloud.


MVC 1.0 vs ASP.Net Webforms
Have you heard about the new ASP.NET MVC framework from Microsoft and wondered what it was all about? Are you curious whether this replaces ASP.Net WebForms? Well in this session you will learn how to use the model-view-controller (MVC) pattern to take advantage of your favorite .NET Framework language for writing business logic in a way that is de-coupled from the views of the data. In addition, we will talk about the pros and cons of both MVC and Web Forms, how to determine the best choice for a specific project, various techniques and patterns used to build MVC applications vs. Web Forms applications, and the implications for using each approach.

The morning session is from 8:00 am to 12:00 pm. Register here.
The afternoon session runs from 1:00 pm to 5:00 pm. Register here.

All events are free and will be held at the Microsoft office in the International Center, 123 Wright Brothers Drive, Suite 100.

Labels: ,


Monday, March 30, 2009

Speaking at DevLink

I will be speaking at DevLink, August 13-15. I've heard great things about this conference and Nashville and am excited to be going. I have two presentations:

Domain Driven Design for the Average Application: Domain Driven Design is a way to design and develop enterprise applications so that they are easier to maintain, enhance, and extend. DDD is overkill for many of the applications we develop today, but still has principles that can be applied to most of the apps we write. In this session, you will learn to apply these concepts.

Continuous Integration in .NET Continuous Integration is a development practice where code changes are continuously checked in to source control and then automatically checked out, built, and tested. Whether you are a one person shop or have many developers, by using Continuous Integration you will improve the quality of your software and increase your productivity. This session will show you how to use Continuous Integration in your daily development by integrating several free tools.

The DDD session is all new. I have been presenting the CI session for about a year and a half, but it will be updated for DevLink. Registration opens April 1. The conference is a bargain at $75. See you there!

Wednesday, March 04, 2009

VFP DDEX Provider Sample Updated

Microsoft today posted an update to the VFP DDEX Provider sample. From Milind's post, "The original VFPDDEX sample did not include a license ID for Visual Studio. This required the user to register with Visual Studio Extensibity program, get a package load key (PLK) and update the provider with the new key.This download fixes this problem. The sample includes the PLK in the resource of the provider. The dowload also contains source code for registering the provider."
Download the update

Thursday, February 05, 2009

MSDN Event in Salt Lake City

I just learned of an MSDN event coming to Salt Lake City on Thursday, Feb. 12 from 1-5. It will be at the Century Theater at 3300 South and State. Three topics will be presented:

Register here.


Wednesday, January 21, 2009

Two speaking gigs scheduled

I have two upcoming speaking gigs scheduled. The first is Saturday, Feb. 21 in Denver at the Rocky Mountain Tech Trifecta. My topic is Continuous Integtration in .NET.

The second is Saturday, March 28 at the Boise Code Camp and Techfest. I have two topics scheduled, Windows Azure and Microsoft Entity Framework.

Monday, January 19, 2009

Nothing Express About SQL Server 2008 Express

Express - adjective
- clearly indicated; distinctly stated; definite; explicit; plain: He defied my express command.
- special; definite: We have an express purpose in being here.
- direct or fast, esp. making few or no intermediate stops: an express train; an express elevator.
- used for direct or high-speed travel: an express highway.
- duly or exactly formed or represented: an express image.

That's the definition of express from dictionary.com. But there is nothing express about SQL Server Express. I have been attempting to install it on a VPC image of Vista Ulitimate, SP1. Here's what I went through:

Express is supposed to lite weight and easy to setup and use. Nothing about this was easy to setup. Install process FAIL. In the end, the install was successful.

Labels:


Saturday, January 10, 2009

Installing Windows 7 and First Impressions

Yesterday I finished downloading Windows 7 Beta. It took over 14 hours. The best speed I could get was less than 50KB/sec. Apparently the Microsoft servers were hammered. After debating if I should install on a virtual machine or install it over the Vista install on my laptop, I went for the direct approach and installed over Vista. I finally chose the latter option. Here's what I did:
  1. Backup Vista hard drive.
  2. Launch Windows 7 install.
  3. Select to get updates. 862K was downloaded.
  4. Chose Custom install. This created a Windows.old folder on the drive that contained the old Vista Windows folder, Perflogs, Users, Program Files, etc. Other folders that I had created were untouched.
  5. Setup then copied files and began to expand them.
  6. Setup rebooted the PC.
  7. After startup, setup continued to expand the files.
  8. Another reboot.
  9. Setup continued, updating the registry and started services. New Windows files were installed.
  10. I was prompted for international settings, country, time zone, etc, for computer name, username, and password. The password hint was required. Why was this required? IMO, it shouldn't be.
  11. I then entered the product key. This step is far too late in the process. Windows should ask me for this before I select any of the previous options.
  12. I then had the option to set the time, which was already correct.
  13. Setup detected the wireless networks available and I selected mine. I was then asked if I wanted to create a Home Group. I chose not to do so.
  14. Setup completed soon after. Total time after I did backup was less than an hour.

Overall, the setup process was very clean and easy. Here are my first impressions:

Overall, Windows 7 seems to be faster and snappier than Vista and I'm happy with it so far. I'm still installing software, so that may change. If you've been debating/waiting to go to Vista, I say wait for Windows 7.

Labels:


Monday, January 05, 2009

Microsoft Event in Salt Lake City

Microsoft is offering an MSDN Unleashed event in Salt Lake City next week, Thursday, January 15. Rob Bagby will be presenting "The Best of the PDC". There will be two sessions. The same material will be presented at each one, so you only need to sign up for one session.

Morning: 8:00 - 12:30 Register at http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032399782&culture=en-US

Afternoon: 1:00 - 5:30 Register at http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032399784&culture=en-US

Both sessions will be at the Microsoft offices in the International Center.

Wednesday, October 29, 2008

Maintaining state in VFP COM+ components

Today I got the following email from a VFP developer:
We are looking to a way to distrubute the application server load (FoxPro MTDLL) by using a COM+ clustering configuration. Question: How FoxPro COM+ state will replicated through all cluster members? The COM+ are mainly to access MS SQL DB.

The answer is:

You can never count on state being replicated across servers. COM+ itself is designed to be stateless. You'll need to keep state information in a central location, for example SQL Server, or send all the state information every time you CREATEOBJECT() on a COM+ object.

Tuesday, October 28, 2008

Windows 7 Debuts

Today at Microsoft's Professional Developer's Conference (PDC) in Los Angeles, Windows 7 was shown for the first time. It appears the main emphasis is to fix some perceived issues with Vista and add more fit and finish. What Microsoft showed is in the product and will be included in the release. In other words, no pie in the sky features. The demo was run on a new laptop with 1Gig RAM, but Win7 only requires 512. Here are some things you'll see in Win7:

Microsoft promised a beta early next year. It will be feature complete but will not be ready for performance testing. The beta will be public and available on microsoft.com. It will be followed by on Release Candidate, then RTM. While Microsoft did not give a date for release, the press is reporting it will be available late 2009.

More Win7 details are expected at the WinHEC conference in about 10 days.

Here are some links to screen shots and more info on Win7 and Office 14.

http://blogs.zdnet.com/microsoft/?p=1675
http://www.techflash.com/microsoft/Microsoft_taking_Office_to_the_browser.html
http://content.zdnet.com/2346-12354_22-244222.html
http://blogs.zdnet.com/Bott/?p=575
http://www.flickr.com/photos/longzheng
http://www.neowin.net/news/live/08/10/28/introducing-the-windows-7-ui
http://www.winsupersite.com/win7/
http://blogs.zdnet.com/microsoft/?p=1676
http://news.cnet.com/8301-10805_3-10074795-75.html?tag=newsLeadStoriesArea.0
http://news.cnet.com/8301-13860_3-10076864-56.html?tag=newsLeadStoriesArea.0
http://news.cnet.com/8301-10805_3-10076883-75.html?tag=newsLeadStoriesArea.0
http://www.winsupersite.com/office/office14_web_preview.asp

Labels:


Friday, October 17, 2008

Winforms, ActiveX, WPF, and VFP

Do you need to create an ActiveX control for you VFP app? Are you adding functionality to your VFP app though .Net? Are you migrating your VFP app to .Net, but can't move the entire app at one time? The Forms Interop Toolkit was developed to assist you in all these scenarios. I've just published a new paper, Integrating .Net Winforms with Visual FoxPro that show how to use the Toolkit to do all this. As an added bonus, the paper also shows how to COM-enable a WPF control and use it on a VFP form.

Labels: , , , ,


Tuesday, October 14, 2008

Windows 7 to be called....

It's official. Windows 7 will be called Windows 7. I applaud this decision. In the past, Windows has used version numbers (3.1, 3.11), years (2000), and even other names (XP, Vista). But I have always preferred version numbers. It goes back to when I was a Clipper developer using the version "Summer '87". Because of updates, you had to check the time stamp on the compiler exe to make sure you had the 2:00 am version. It's so much easier to just check the version number. So hooray to Microsoft for going back to version numbers. I hope other Microsoft teams and other vendors follow.

Friday, October 03, 2008

Utah Most Digital State

"Utah topped the Center for Digital Government's (CDG) 2008 Digital States Survey after delivering the clearest evidence yet that electronic delivery of government services has matured.

To reduce energy costs and carbon emissions, Utah Gov. Jon Huntsman Jr. announced in June that most state offices would be closed on Fridays. With more than 800 state government services online -- many boasting high user adoption rates -- Utah could close physical offices statewide without inconveniencing citizens." http://www.govtech.com/gt/418945?topic=117673

Thursday, October 02, 2008

Finally! An MSDN Event in Utah

After a long absence, an MSDN event has been scheduled in Utah! "MSDN Events Unleashed: Demystifying WPF, Silverlight 2 and Visual Studio 2008 SP1" is scheduled for Thursday, October 23 from 1:00 - 5:00 at the Microsoft offices in the International Center.

The first 50 people to register will get a free copy of the book "Applications = Code + Markup" by Charles Petzold.

The event overview states:
Today’s applications need to do more than simply work. They need to draw
in the user, and provide a differentiated experience. This means moving beyond
battleship gray forms boxy UIs and simple HTML forms, and providing a positive
user experience. Windows Presentation Foundation (WPF) and Silverlight 2
provide powerful capabilities to develop compelling user interfaces, on the
client and in the browser, respectively.

At the heart of
these rich applications is data. There are a growing number of choices of
technologies available to access data, create database abstraction layers and
expose data as services. Visual Studio 2008 (and .NET Framework 3.5) SP1
include the production release of the ADO.NET Entity Framework, ADO.NET Data
Services, as well as some enhancements to the Web Programming model
(REST-Friendly) in WCF.

In this session, Rob Bagby will
examine the core concepts of WPF and Silverlight such as layout panels, data
binding, styles and control templates, and will use them to develop an
application UI from the ground up. Rob will further examine and demystify
the options available to you to expose data to your rich applications.
Register here.

Wednesday, October 01, 2008

Microsoft MVP Award

I am honored to again have been named a Microsoft Most Valuable Professional. The award is given for providing community support in both online and in-person venues. I look forward continue to helping you understand Microsoft technologies and develop outstanding applications for your customers.

Wednesday, September 03, 2008

Is Google the new evil empire?

Several people have asked me if I have installed Chome, Google's new web browser. No, not yet. I've been too busy getting work done, but it's been in my plans to try it out in a couple of weeks when I have more time. However, after reading Roger Jenning's blog post on the Chrome Terms of Service, I doubt I ever will. Wow.. those terms are worse than Microsoft's.

And for the record, I don't agree with the journalists and prognosticators (weathermen are more accurate) that say Chrome will be the end of Windows and IE. We've heard it all before. It didn't happen then and it won't happen now.

Ken Levy Joining EPS

Ken Levy, long time VFP Product Manager and longer time FoxPro developer is joinng EPS in the role as Evangelist, primarily focused on VFPConvesion.com. Read the press release.

Labels:


Thursday, August 28, 2008

Don't FILTER Data in a Grid

I've seen several postings on the forums lately where people ask about how to FILTER data displayed in a grid. This is a very bad idea as the scroll bars and thumb don't work correctly. Look at this form, that uses a filter.




The underlying table has over 200,000 rows. I appyled SET FILTER TO Lname = "SMITH". The result is not good. Notice the postion of the thumb. When I pull the thumb to the top of the scroll bar, it jumps back to the postition shown in the screen shot because that's where the current record is based on the entire table. This is very confusing to a user.
Now look at what happens when you use a query or a view.



In this form, I set up a local view and set the grid to use the view as the data source. I then requeried the data using a View Parameter. Notice where that the thumb is located at the top of the scrollbar when the record pointer is on the first record. This is because the data for the grid only contains rows where Lname = "SMITH" rather than the entire table.

Writing applications this way may require a retraining of the users as they won't have all the data at the same time, but will always need to query the data they want. My experience shows that users prefer this type of application. YMMV.

An added bonus is that you're preparing yourself to work with SQL Server as it only uses sets of data. You always need to query for the data you want and get back only that data rather than everything.

Labels:


Why Vista is more stable than XP

Windows Vista has been much maligned by the press and users alike, mostly because of UAC, but when you start to look at improvements in Vista and understand why they are there, Vista becomes more and more attractive. One of the big changes in Vista was with device drivers. Note that I'm not a hardware wonk. I'm sure someone will correct me for any incorrect information here.

For years, Microsoft has used the "Dr. Watson" tool to get back information about system crashes. You are probably familiar with the dialog that is displayed. You know, the one that says, "This application has performed an illegal operation. Would you like to send information to Microsoft?" Turns out, that information had lots of good stuff in it. Microsoft learned that 80% of crashes were caused by third party software and a very high percentage of that was caused by misbehaving device drivers. The result was often a system crash, the dreaded blue screen of death.

Many times, the reason this happened is because the Windows kernel and the device driver were running in the same ring on the CPU. The rings are numbered 0-4 on Intel chips. Ring 0 is closest to the hardware, meaning anything running in ring 0 has the most direct access to the hardware. Anything in ring 3 has the least direct access. Under Windows XP and earlier, the kernel and the device driver both ran in ring 0. User applications ran on ring 2. Rings 1 and 3 were unused.



You may think this is crazy. Why not run device drivers in a different ring? Well, it all comes down to the early days of Windows. There were more than Intel and AMD chips around. Windows also ran on the Alpha computer from Digital Equipment Corp. (DEC). Turns out, the CPU in the Alpha only had two rings, not four, so to simplify coding, Microsoft decided that they would only use two rings on the Intel chips. However, in 1998, DEC was acquired by Compaq (which later was acquired by HP) and eventually the Alpha was killed.

Now, when Microsoft was designing Vista, one of the goals was to make the OS more stable. They looked at all the data on blue screens. Even though the large majority of them was caused by third party drivers, most user blamed Microsoft for them. With the Alpha out of the picture, the decision was made to move device drivers to ring 1.


The benefit is that if a driver crashes, it is now less likely to cause the entire system to crash. The downside is that vendors had to rewrite many device drivers so they would run correctly in ring 1...and that led to many people saying that Vista device driver support was horrible. They still blamed Microsoft for it, but did so without understand why Microsoft changed how device drivers were to be implemented.

Today, most of the device driver issues have been resolved, unless you have really old hardware. There are still other areas that people hate about Vista, particularly UAC, but again, it's there for a reason. So, before you just throw in the towel and bash Vista, think about what the design goals may have been for the "feature" and try to look at it from a different perspective.

Update: Andrew MacNeill posts "Craig - this is what they should be doing instead of Mojave...yes, it's techy - but it explains it right." I meant to put this in my original post.

Wednesday, August 20, 2008

Speaking tonight in Utah county

I will be speaking tonight at the Utah County .NET User Group. The topic is Continuous Integration for .NET Development. The meeting is at 6:00 at NuSkin Operations Center, 1175 S. 350 E., Provo.

Thursday, July 31, 2008

Comparing Files

When you write code for a living, it becomes important to compare files. Sometimes you have to know what changed between versions or even worse, when multiple devs can update the same source and you need to know what the other person changed. For a few years, I've used Beyond Compare from Scooter Software. It's easy to use and does an amazing job of comparing differences and allow you to synch up the two files if needed. I found out this morning that Beyond Compare 3.0 is out. I couldn't imagine how they could make this product better, but the list of changes is amazing.. I'm in the process of downloading and installing the new version.

Wednesday, July 16, 2008

Utah User Groups

I just came across a list of Utah user groups. While I know of groups that are missing, for example, SQL Server and BI groups, it is the most complete list I've seen.

Wednesday, July 09, 2008

Error messages

I got this error message this morning while opening a project in Borland C++ Builder. It could have had a tad more information.

Tuesday, July 08, 2008

Sandcastle is back

A few weeks ago, Microsoft pulled it's Sandcastle managed code documentation tool from the web when someone complained that it didn't come with source code, as was required by the licensing agreement on CodePlex. Now, it's back on CodePlex and includes the source.

Thursday, July 03, 2008

Beware of Microsoft Equipt

Remember Enron? It was the Houston company that used the same accounting firm for it's accounting and auditing, then became one of the largest corporate failures in history when it was revealed the executives cooked the books. Well, Microsoft has just announced a new program called Microsoft Equipt, where you can get Word, Excel, PowerPoint, One Note, OneCare, Live Messenger, Live Photo Gallery, Live Mail, Live Writer, and Live Toolbar for under $70/per year. It's not the yearly license fee that bothers me, it's having to use OneCare for anti-virus protection. The Microsoft web site says, "It is not possible to install Microsoft Equipt without Windows Live OneCare". IMO, using a Microsoft anti-virus to protect Windows is like using the same company for your accounting and auditing. Personally, I don't want to Enron my PC. I don't think I can recommend this program.

Wednesday, July 02, 2008

C# to Excel Interop Color Bug

I'm rewriting my SQL documenter in C# 3.0 and came across a bug with Excel interop. I need to set the background color of some cells to light yellow, but when I use this code:
curRange.Interior.Color = Color.LightYellow.ToArgb();
it comes out as light cyan. I tried Color.Yellow and it comes through as Cyan. The solution is to use Cyan:
curRange.Interior.Color = Color.LightCyan.ToArgb();
to get light yellow. I added a comment to the code about why the colors are reveresed.

Wednesday, June 25, 2008

Documenting a SQL Server Database

I recently had a need to document the schema of a SQL Server database. The requirement was to have one worksheet per table and match the formatting done on similar project. The database I actually had to document contains over 300 tables. I worked up some Visual FoxPro code to do this automatically.
* Document SQL tables into Excel

LOCAL oXl AS Excel.Application
LOCAL oSheet AS EXCEL.Sheets
LOCAL oActiveSheet AS EXCEL.Worksheet


oXl = CREATEOBJECT("Excel.Application")
oXl.Visible = .T.
oWkb = oXl.Workbooks.Add()
oActiveSheet = NULL

lnHandle = SQLSTRINGCONNECT("Driver=SQL Native Client;Server=.;database=Northwind;Trusted_Connection=yes")
SQLEXEC(lnHandle, "Exec sp_tables", "cTables")
SELECT cTables
INDEX ON Table_Type TAG TableType DESCENDING
SCAN FOR Table_Type = "TABLE"
oSheet = oXl.Sheets.Add()
loActiveSheet = oXl.ActiveSheet

SQLEXEC(lnHandle, "Exec sp_columns '" + ALLTRIM(cTables.Table_Name)
+ "'", "cColumns")

* Add the top two rows with table information after adding the column stuff
* so that the columns will autosize properly
XLAddColumn(loActiveSheet, "cColumns")
loActiveSheet = XLAddTable(loActiveSheet, cTables.Table_Name)
ENDSCAN

SQLDISCONNECT(lnHandle)
oSheet = NULL
oWkb = NULL
oXl = NULL

*********************************

FUNCTION XLAddTable(toActiveSheet, tcTableName)
LOCAL lcTable
LOCAL toActiveSheet AS EXCEL.Worksheet

lcTable = ALLTRIM(tcTableName)
* Handle the sheet title (table name)
toActiveSheet.Name = lcTable
toActiveSheet.Range("A1") = ALLTRIM(tcTableName) + " Table"
toActiveSheet.Range("A1").Font.Name = "Arial"
toActiveSheet.Range("A1").Font.Size = 14
toActiveSheet.Range("A1", "F1").Interior.Color = 12632256
toActiveSheet.Rows(1).RowHeight = 24.75
toActiveSheet.Range("A1:F1").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("A1:F1").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("A1:F1").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("A1:F1").Borders(10).Color = RGB(0, 0, 0)

* Column Titles
toActiveSheet.Range("A2") = "Column Name"
toActiveSheet.Range("A2").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("A2").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("A2").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("A2").Borders(10).Color = RGB(0, 0, 0)

* Data type
toActiveSheet.Range("B2") = "Data Type"
toActiveSheet.Range("B2").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("B2").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("B2").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("B2").Borders(10).Color = RGB(0, 0, 0)

* Precision
toActiveSheet.Range("C2") = "Precision"
toActiveSheet.Range("C2").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("C2").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("C2").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("C2").Borders(10).Color = RGB(0, 0, 0)

* Length
toActiveSheet.Range("D2") = "Length"
toActiveSheet.Range("D2").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("D2").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("D2").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("D2").Borders(10).Color = RGB(0, 0, 0)

* Scale
toActiveSheet.Range("E2") = "Scale"
toActiveSheet.Range("E2").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("E2").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("E2").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("E2").Borders(10).Color = RGB(0, 0, 0)

* Comments
toActiveSheet.Range("F2") = "Comments"
toActiveSheet.Range("F2").Borders(7).Color = RGB(0, 0, 0)
toActiveSheet.Range("F2").Borders(8).Color = RGB(0, 0, 0)
toActiveSheet.Range("F2").Borders(9).Color = RGB(0, 0, 0)
toActiveSheet.Range("F2").Borders(10).Color = RGB(0, 0, 0)

* Format the cells
toActiveSheet.Range("A2", "F2").Font.Bold = .T.
toActiveSheet.Range("A2:F2").VerticalAlignment = 2
toActiveSheet.Range("A2", "F2").Interior.Color = 8454143
toActiveSheet.Rows(2).RowHeight = 26.25

toActiveSheet.Columns("B").Autofit()
toActiveSheet.Columns("C").Autofit()
toActiveSheet.Columns("D").Autofit()
toActiveSheet.Columns("E").Autofit()
toActiveSheet.Columns("F").Autofit()

RETURN loActiveSheet
ENDFUNC

*********************************

FUNCTION XLAddColumn(toSheet, tcColCursor)
LOCAL lnWorkArea
LOCAL toSheet AS EXCEL.Worksheet

lnWorkArea = SELECT()
tcCell = ""

SELECT (tcColCursor)
SCAN
* Column name
tcCell = "A" + ALLTRIM(STR(RECNO() + 2))
toSheet.Range(tcCell) = ALLTRIM(Column_Name)
toSheet.Range(tcCell).Borders(7).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(8).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(9).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(10).Color = RGB(0, 0, 0)

* Data Type
tcCell = "B" + ALLTRIM(STR(RECNO() + 2))
toSheet.Range(tcCell) = ALLTRIM(Type_Name)
toSheet.Range(tcCell).Borders(7).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(8).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(9).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(10).Color = RGB(0, 0, 0)

* Precision
tcCell = "C" + ALLTRIM(STR(RECNO() + 2))
toSheet.Range(tcCell) = Precision
toSheet.Range(tcCell).Borders(7).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(8).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(9).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(10).Color = RGB(0, 0, 0)

* Length
tcCell = "D" + ALLTRIM(STR(RECNO() + 2))
toSheet.Range(tcCell) = Length
toSheet.Range(tcCell).Borders(7).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(8).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(9).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(10).Color = RGB(0, 0, 0)

* Scale
tcCell = "E" + ALLTRIM(STR(RECNO() + 2))
toSheet.Range(tcCell) = Scale
toSheet.Range(tcCell).Borders(7).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(8).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(9).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(10).Color = RGB(0, 0, 0)

* Comments
tcCell = "F" + ALLTRIM(STR(RECNO() + 2))
toSheet.Range(tcCell).Borders(7).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(8).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(9).Color = RGB(0, 0, 0)
toSheet.Range(tcCell).Borders(10).Color = RGB(0, 0, 0)
ENDSCAN

toSheet.Columns("A").Autofit()

SELECT (lnWorkArea)
ENDFUNC

Labels: ,


Friday, June 13, 2008

VS2008 & .Net 3.5 SP1 Beta

This morning I installed the .Net Framework 3.5 Service Pack 1 Beta and the Visual Studio 2008 Service Pack 1 Beta. The Framework beta required a reboot after install, but I expected it would. The VS beta required my original VS media CD. I've said before that an SP should never require the original CD. The second install took quite a bit longer then the first. Scott Guthrie blogged details on what all the goodies in the Service Packs and some warnings you should look at before install. As always, this is beta software and should not be installed on a production machine. Microsoft is targeting a late summer release of both SPs.

Thursday, June 12, 2008

Speaking tonight Utah .Net User Group

I'm speaking tonight at the Utah .NET User Group. The presentation will part of the Microsoft Community Launch and will be geared to "What's New in C# 3.0" and "LINQ". I had some earlier requests to cover round tripping WPF between Visual Studio 2008 and Expression Blend and What's New in VB 9.0. If there is still interest tonight on those topics, we'll breifly cover them.

NOTE THE LOCATION CHANGE FOR TONIGHT
The meeting starts at 6:00 at the Microsoft offices, 123 Wright Brothers Drive, Salt Lake City. This is in the International Center, just west of the airport.

Monday, June 02, 2008

Desert Code Camp Followup

Last Saturday I was in Tempe for Desert Code Camp. It was a great experience to be there and talk to developers from the Phoenix area. As promised, here is the sample code from my LINQ session. The Continuous Integration whitepaper can be found here. Thanks to Lorin and everyone there for making me feel welcome!

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]