Code/Tea/Etc...

Duncan Mackenzie has too much time on his hands

My MSDN Magazine article is up on the MSDN site...

It is all about "My", a feature of Visual Basic 2005... and I think it is fairly interesting stuff :)

Check it out here...

 

Published Wednesday, April 21, 2004 10:39 PM by Duncanma

Comments

 

Stefano Demiliani said:

Really interesting... thanks!
April 22, 2004 1:14 AM
 

Ninputer said:

The 'My' namespace is so cool!
April 22, 2004 5:05 AM
 

Samuel Jack said:

Will any parts of the My namespace be available through C#?
April 22, 2004 7:00 AM
 

Panopticon Central said:

Check out the great new feature!
April 22, 2004 4:03 PM
 

Brian R. James said:

"My" seems very usefull. I certainly hope it will be available to c# developers as well.
April 22, 2004 3:38 PM
 

Duncan Mackenzie said:

As far as I know (Samuel and Brian), "My" is a VB-Only feature.
April 22, 2004 3:40 PM
 

Stephen Toub said:

Parts of it are available to C#, but not in as easily accessible a way as it is for VB developers.

As Duncan points out in his article, My provides easy access to two different categories of information. First, My makes it easier to get at parts of the framework, and second, My exposes information about your current project. It does the former predominantly using the Microsoft.VisualBasic.dll, which exposes classes such as Computer, FileSystem, etc. In C#, you could certainly add a reference to this dll and use its functionality in your C# applications. You could even use an alias to make using it more similar to writing in VB:
using My = Microsoft.VisualBasic;
or something like that. Not exactly the same, but similar.

That said, a good chunk of My is implemented in the compiler. If you examine the exe or dll compiled from a Visual Basic project that uses My, you'll see a whole set of classes generated for you by the VB compiler. These classes expose information about the forms, web services, etc, in your project, and they're what make My.Forms, My.WebServices, etc, possible. It'd be much harder to get this functionality in C#, though you might be able to craft something using reflection to walk through your assembly looking for classes that derive from Form, classes that have methods attributed with WebMethod, etc. Definitely not as clean or efficient, wouldn't give you strong typing, and not built for you already like it is in VB.
April 22, 2004 8:27 PM
 

muhammad khan said:

I am intrested in VB LANGUAGE
April 23, 2004 2:47 AM
 

muhammad khan said:

WEIKUROIUEWFHSDMCMNBSXXC
April 23, 2004 2:49 AM
 

Stephen Toub said:

Oops, My.WebServices is client side, not server side, so if you wanted to semi-replicate its functionality using reflection, you'd have to find all classes that derive from the soap client proxy rather than those that have methods attributed with WebMethod.
April 23, 2004 6:55 AM
 

robert smith said:

so... a bit off topic, I guess: You're still calling it "VS 2005"? I guess that's fine (Win95 came out the tail end of November 1995 after all so it squeaked in too) but I just had to ask. Over a year out, "how much of this is really going to be in the product" might be the real question I should be asking even though I realize it can't be answered till... 2006 maybe.

Nice artice though thank you. Can't wait to see more on the language/syntax because, to be honest, it's getting tiresome to keep hearing so much about new Wizards that VB8 is getting which implies that MS has decided that most of us only use VB syntax because we're too stupid to write code ;-)

Thanks again.
-smith, Kirkland
April 24, 2004 11:40 PM
 

robert smith said:

so... a bit off topic, I guess: You're still calling it "VS 2005"? I guess that's fine (Win95 came out the tail end of November 1995 after all so it squeaked in too) but I just had to ask. Over a year out, "how much of this is really going to be in the product" might be the real question I should be asking even though I realize it can't be answered till... 2006 maybe.

Nice artice though thank you. Can't wait to see more on the language/syntax because, to be honest, it's getting tiresome to keep hearing so much about new Wizards that VB8 is getting which implies that MS has decided that most of us only use VB syntax because we're too stupid to write code ;-)

Thanks again.
-smith, Kirkland
April 24, 2004 11:41 PM
Anonymous comments are disabled

This Blog

Syndication

News

This blog has moved to my own VB site

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker