Finding what you need in the Microsoft® Visual Studio® 2005 documentation, which has over 200,000 topics, can be a daunting task. The Doc Detective is here to help, utilizing his investigative skills to probe the depths of the documentation.

Can’t find what you’re looking for? Just ask-if it’s in there, I’ll find it for you; if it isn’t, I’ll let you know that as well (and tell you where else you might go to find it).

Have a question for the Doc? Send your questions for future columns to me at docdetec@microsoft.com.

Dear Doc Detective,

I am working on an application that creates and edits custom documents, saving the files with a .dox file extension. I want users to be able to double-click on a .dox file and open it for editing in my program.

Short of having each end user manually create the file association in Windows Explorer, is there an easy way to do this?

- Disassociated in Danville

Dear Disassociated,

It depends on your definition of “easy” -and on how you are deploying your application. If you are using a Setup and Deployment project to create a .msi setup, you can do this in the File Types editor.

Just add a document type (basically a description) and an extension to use, and then tell it what program to associate them with. During installation the file association will be registered for you. You can learn more about this in the topic, “How to: Add and Delete Document Types and Associated File Extensions in the File Types Editor”.

One caution, though-be careful not to use a file extension that already exists for another common application. Users tend to get a bit upset if, for example, their Word documents start opening in your application instead of in Word.

- Doc D

Dear Doc Detective,

I am looking for some documentation on UDDI. I want to expose all of the Web methods from different Web services into one UDDI Service.

I’m pretty sure this can be done, but I can’t find anything online. I will be forever indebted to you if you can help.

--Befuddled in Beverly Hills

Dear Befuddled,

It does appear that the documentation on UDDI is rather sparse. I looked up “UDDI” in the index and all I found was the Glossary description. I looked up “Universal Description, Discovery and Integration” and found “see UDDI”, which brought me back to the same topic. Not terribly helpful, to say the least.

I’m not exactly clear on what you are asking-there is no such thing as a UDDI service, so I assume you are asking how to expose multiple Web Services on a single UDDI server. The Knowledge Base article, “How to publish an XML Web service to an internal UDDI server by using Visual C# .NET 2003” describes the process for publishing to a UDDI server.

For more general information about UDDI, you might look at the Microsoft UDDI SDK. A good starting point would be the topic, “Getting Started with the Microsoft UDDI SDK”. Now-about that debt...

- Doctor D

Dear Doc Detective,

I am writing a program that logs keystrokes. I’ve already figured out how to get the name of the key being pressed in the KeyDown event using e.KeyCode.ToString.

My problem is that when NumLock is on, key presses return the KeyCode for the number rather than for the functions such as the arrow keys. How can I get the function values instead of the numbers?

- Keyed up in Keystone

Dear Keyed,

Interestingly enough the values returned by KeyCode are somewhat inconsistent. If NumLock is on, pressing the 1 key on the keyboard returns the string “D1” and pressing 1 on the numeric keypad returns “NumPad1”. If Numlock is off, pressing the End key on the keyboard or the 1 key on the numeric keyboard both return “END”.

What this means is that you can’t differentiate between the keyboard and the numeric keypad unless NumLock is on. In your case, however, it sounds like you only want to capture the keys when NumLock is off and you don’t care whether the key press is coming from the keyboard or keypad. If that is the case, you could simply check the state of the NumLock key and warn the user if it is on.

The Keyboard object in the My namespace can be used to check the key state in the KeyDown event as follows:

End If

In addition to getting the state of the NumLock key, the Keyboard object can also return the state of the Alt, CapsLock, Ctrl, ScrollLock, and Shift keys. You can learn more about the Keyboard object in the topic, “My.Computer.Keyboard Object Members”. As the Doc always says, knowledge is Key.

- Doc D

Dear Doc Detective

Is there a way to have a user log-in to a Visual Basic 2005 app using their Windows log-in? I have a customer who wants to alter what’s available/exposed to the user in their VB application based upon their log-in credentials. I don’t know what to look for or where to start.

- Lost in Longview

Dear Lost,

What you are looking for is Windows authentication, and yes, there is a way to use it from your Visual Basic application. A good place to start is the topic, “Authentication and Authorization in the .NET Framework with Visual Basic”, which is a portal to several introductory topics on the subject.

Once you understand the basics, the topic, “Walkthrough: Implementing Custom Authentication and Authorization” can walk you through the process and provide some code examples. Assuming, of course, that you are authenticated and authorized.

- the Doc

Doc’s Doc Tip of the Day

Want to keep up on the latest development news from Microsoft? MSDN Flash is a bi-weekly newsletter that contains pointers to all of the new articles, samples, and headlines from MSDN Online, the MSDN Library, the Knowledge Base, the Developer Centers, and other Microsoft Web sites.

You can customize MSDN Flash to contain information only on technologies and programming languages that interest you. Sign up for MSDN Flash from the MSDN library homepage.

Found a topic in Help that doesn’t help? Tell the Visual Studio documentation team about it at vsdocs@microsoft.com.

URLs

http://msdn2.microsoft.com/en-us/library/4fcx9b75(VS.80).aspx

http://support.microsoft.com/default.aspx/kb/833380

http://msdn2.microsoft.com/en-us/library/aa966198.aspx

http://msdn2.microsoft.com/en-us/library/ms172976(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/ms233780(VS.80).aspx

http://msdn2.microsoft.com/en-us/library/ms172766(VS.80).aspx

http://msdn2.microsoft.com/en-us/flash/default.aspx