473,698 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why SOMETIMES when i try to assign an object to null in immediate window i can't?

TS
I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why ?

thanks
Sep 28 '06 #1
7 1722
Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(o bject sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=nul l" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 29 '06 #2
TS
any comments?

"TS" <ma**********@n ospam.nospamwro te in message
news:ug******** ******@TK2MSFTN GP04.phx.gbl...
>I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...wh y?

thanks

Oct 5 '06 #3
TS <ma**********@n ospam.nospamwro te:
any comments?
There was one from Jeffrey Tan of Microsoft, which was full of
pertinent questions. Please answer those. Most importantly, please
provide a short but complete program which demonstrates your problem.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 5 '06 #4
TS a écrit :
any comments?

"TS" <ma**********@n ospam.nospamwro te in message
news:ug******** ******@TK2MSFTN GP04.phx.gbl...
>I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...wh y?
Hello,

Perhaps about Structure type, like a DateTime : you cannot assign null toa
DataTime object because it is a srtuct.

HTH.
Oct 5 '06 #5
Hi TS,

I am reviewing this issue thread. It seems Jeffery's reply is omitted. I am
not sure of whether this is a system error. So I pasted it again in the
following. Your further information is quite helpful for the issue
resolution. Thanks very much and look forward to your reply.

-----
From: je***@online.mi crosoft.com ("Jeffrey Tan[MSFT]")
Date: Fri, 29 Sep 2006 08:57:54 GMT
Subject: RE: Why SOMETIMES when i try to assign an object to null in
immediate window i can't?
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp

Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(o bject sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=nul l" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
-----

Sincerely,
Yanhong Huang
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #6
TS
i've been viewing posts thru outlook express and it never came over. I just
now see this post and Cyrille37 and Yan-Hong. That is aggrevating because
i've been checking this post every day.

thanks for informing me, i guess OE is quirky. (This has happened before).
i'll check out the other post from the website.

"Jon Skeet [C# MVP]" <sk***@pobox.co mwrote in message
news:MP******** *************** *@msnews.micros oft.com...
TS <ma**********@n ospam.nospamwro te:
>any comments?

There was one from Jeffrey Tan of Microsoft, which was full of
pertinent questions. Please answer those. Most importantly, please
provide a short but complete program which demonstrates your problem.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Oct 6 '06 #7
TS
First off i'd like to say that I never got this post thru outlook express and
only just now see this post thru the website...

vs 2003, web app, C#

i'm also sorry to say that i have shutdown VS since my post so long ago, and
i cannot retrieve that line from the command window and don't recall which
object i was working with.

When i come across it again, i will make sure to get the code to simulate it
and post it. I do know that i have run across this more than a couple of
times in the last year at different spots.

thanks

""Jeffrey Tan[MSFT]"" wrote:
Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(o bject sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=nul l" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #8

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

Similar topics

2
993
by: Hai Ly Hoang | last post by:
My application is an MDI. It has an MDI window (main window). Now, I want to create a nother MDI window CMDIFrameWnd *main = new CMDIFrameWnd(); main->LoadFrame(IDR_ANALYSE, WS_OVERLAPPEDWINDOW | 32768, NULL, NULL); main->ShowWindow(SW_SHOW); Now, i create several child window in new MDI window main->CreateNewChild(RUNTIME_CLASS(ChildFrame));
8
7397
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to assign value form the object to text Box it gives error 'Object required' Dim strResponse As String strResponse = strResponse & "<script language=""JavaScript"">" & vbCrLf strResponse = strResponse & "var aForm; " & vbCrLf
20
6975
by: weston | last post by:
I've got a piece of code where, for all the world, it looks like this fails in IE 6: hometab = document.getElementById('hometab'); but this succeeds: hometabemt = document.getElementById('hometab'); Has anyone ever seen anything like this before, or am I dreaming?
1
4173
by: mathewda | last post by:
Hey, I'm having a problem that I consider kinda weird that is alluding me at the moment. I've wrote some code that will set up an XMLHttpRequest, it then makes a call to open and send and sets the onreadystatechange to another function of mine. onreadystatechange checks the ready state and if the ready state is 4 and the status is 200 it assigns to the innerHTML of a div. I also have some code that uses the attachEvent method so that all...
19
3582
by: Mark Rae | last post by:
Hi, Is it possible to have programmatic access to the Page object in Application_BeginRequest, or is it too early in the lifecycle...? E.g. to be able to change a page's MasterPage dynamically, something like: protected void Application_BeginRequest(Object sender, EventArgs e) { if (Session == "True")
5
5643
by: vul | last post by:
In VB6 I used to use Immediate Window to get or change values of variables. It is very convenient while debugging. I used drag and drop operation to paste the variable name into Immediate Window. In VB 2005 this approach either doesn't work or I need to do it some different way. Of course VB 2005 environment allows to see values right in the code window, but it's true only for not too long strings. With a long string I still need Immediate...
6
2839
by: Frank Rizzo | last post by:
I am using the Immediate Window a lot to see the progress of the application. In VS2003, if your cursor was at the very bottom, the window would scroll down whenever something new showed up. If your cursor was somewhere in the middle of the text output, then there would be no scrolling. In VS2005, the Immediate Window scrolls regardless of where the cursor is which is very annoying. Sometimes you want to go back up in the window to...
2
3131
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the same column then mouseup anywhere in a cell. The mouseup event sometimres fires before the selection of table cells by dragging is complete. It's important that I stop these "false" mouseup's from firing or distinguish them from when I let go of...
0
8611
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.