473,387 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

.NET 2.0 Conversion Wizard Flags Me.Cursor?

Hi

As per subject when using the converter wizard in vs2005 to convert vb 1.1
to 2.0 code i get warnings (lots of them) about silly stuff like
Me.Cursor.Current.

It says

Access of shared member, constant member, enum member or nested type through
an instance; qualifying expression will not be evaluated.

How does me.cursor qualify for this treatment and what does it mean if i
choose to do nothing about it. The code compilies fine.

Thanks

Lenny
Mar 2 '06 #1
4 3099
VB allows you to access a shared method with an instance - in your example
"Me" is the instance. The "Cursor" property is a shared property however, so
there's no need to use an instance - just use the class. VS is simply
informing you that the "Me" will not be evaluated - useless message in this
case, but if your instance term was more complicated then it could be
informative.

Accessing shared members via an instance is sloppy. I think the warning is
there now to gradually wean people off the practice since perhaps Microsoft
will remove this capability in VB in the future? (just guessing)
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"Learnicus" wrote:
Hi

As per subject when using the converter wizard in vs2005 to convert vb 1.1
to 2.0 code i get warnings (lots of them) about silly stuff like
Me.Cursor.Current.

It says

Access of shared member, constant member, enum member or nested type through
an instance; qualifying expression will not be evaluated.

How does me.cursor qualify for this treatment and what does it mean if i
choose to do nothing about it. The code compilies fine.

Thanks

Lenny

Mar 2 '06 #2
Lenny,

Since Current is a shared property of the Cursor class, you just need to use
Cursor.Current instead of your form's instance of the Cursor class.

Kerry Moorman
"Learnicus" wrote:
Hi

As per subject when using the converter wizard in vs2005 to convert vb 1.1
to 2.0 code i get warnings (lots of them) about silly stuff like
Me.Cursor.Current.

It says

Access of shared member, constant member, enum member or nested type through
an instance; qualifying expression will not be evaluated.

How does me.cursor qualify for this treatment and what does it mean if i
choose to do nothing about it. The code compilies fine.

Thanks

Lenny

Mar 2 '06 #3
Thats excellent. Thanks you both.

I got a bit confused because prior to posting I looked up the status of the
System.Form.Cursor. This is an overridable instance property not a shared
property so i couldn't figure out what VS was on about.
I couldn't work out why this was flagged given that Me is an instance and so
is Me.Cursor... anyways got it now.

Any idea how to turn these green under line sqiggles warnings off, i looked
in Tools/Options and im showing all settings but i cant see the option. I'll
deal with it later but for now i dont want the distraction.

Thanks

Lenny

"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
Lenny,

Since Current is a shared property of the Cursor class, you just need to
use
Cursor.Current instead of your form's instance of the Cursor class.

Kerry Moorman
"Learnicus" wrote:
Hi

As per subject when using the converter wizard in vs2005 to convert vb
1.1
to 2.0 code i get warnings (lots of them) about silly stuff like
Me.Cursor.Current.

It says

Access of shared member, constant member, enum member or nested type
through
an instance; qualifying expression will not be evaluated.

How does me.cursor qualify for this treatment and what does it mean if i
choose to do nothing about it. The code compilies fine.

Thanks

Lenny

Mar 2 '06 #4
"Learnicus" <sp******@nospam.com> schrieb
Thats excellent. Thanks you both.

I got a bit confused because prior to posting I looked up the status
of the System.Form.Cursor. This is an overridable instance property
not a shared property so i couldn't figure out what VS was on about.
I couldn't work out why this was flagged given that Me is an
instance and so is Me.Cursor... anyways got it now.

Any idea how to turn these green under line sqiggles warnings off, i
looked in Tools/Options and im showing all settings but i cant see
the option. I'll deal with it later but for now i dont want the
distraction.

You can change it in the project's properties.
Armin
Mar 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Charles Atwood | last post by:
I am trying to use the Java Language Conversion Assistant 2.0 with Visual Studio .NET 2003 on Windows 2000 Server SP4 and .NET framework 1.1 to convert some java files to C#. I go through all the...
0
by: VB Programmer | last post by:
Simple ASP.NET 1 site. Opened solution in beta 2 of 2.0. Ran thru conversion wizard and it states: "Conversion Complete. There were some errors during conversion." I view the conversion log...
2
by: Jim Benson | last post by:
Where is the .NET conversion Wizard. I'm told when trying to open a Vb6 app that the Wizard isn't installed but can't find it on the installation CDs. I would like to see what kind of a job it does...
7
by: guy | last post by:
Has anyone any experience of the conversion wizard for VB6 to VB2005? if so how good is it? also how does it handle database related conversions i.e is ADO converted to ADO.NET etc. the project...
1
by: musosdev | last post by:
Hi I've got a project I've just run through the conversion wizard, and it's giving me a few headaches. I've got a user control which has controls referrenced from its calling page...
1
by: Sai | last post by:
Hi I am new to .Net, I have a code in VB.Net and would like to convert that to c#. Could any one please help me as I have tried the tool "developfusion" web site but its of no luck. Here is my...
0
by: =?Utf-8?B?RWFjaHVz?= | last post by:
I've made several attempts to upgrade an application from asp.net 1.1 to 2.0. I open the web site by selecting the vbproj file, by selecting the solution file, or by selecting the web application....
0
by: Marchand | last post by:
Hi, after the Visual Studio 2005 vb6 to vb.Net conversion wizard end execution, the projet does not load properly in the solution. The error is file not found. But when I look in the...
1
ssnaik84
by: ssnaik84 | last post by:
Hi Guys, Last year I got a chance to work with R&D team, which was working on DB scripts conversion.. Though there is migration tool available, it converts only tables and constraints.. Rest of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.