473,408 Members | 1,747 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,408 software developers and data experts.

null is unrecognized literal

I'm trying to run some code I typed in from "Pro .Net 2.0 Windows Forms
and Custom Controls in C#", and I'm getting two errors that seem like
they shouldn't be happening.

One example is:

if (mc == null) [where mc is a reference to Quartz.dll, which I
pulled in by letting VS 2008 do an interop]

It gives me something like "null is an unrecognized literal".
Next one is:

if (mc.ShowDialog() == DialogResult.OK)

it comes back and says "OK is unrecognized Enum"

Is there some namespace I need to pull in to make these work?

Jan 16 '08 #1
11 1413
Hi,

No, ar eyou sure u r creating a C# project?

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"doofy" <no**@notme.comwrote in message
news:47***********************@news.sonic.net...
I'm trying to run some code I typed in from "Pro .Net 2.0 Windows Forms
and Custom Controls in C#", and I'm getting two errors that seem like they
shouldn't be happening.

One example is:

if (mc == null) [where mc is a reference to Quartz.dll, which I pulled
in by letting VS 2008 do an interop]

It gives me something like "null is an unrecognized literal".
Next one is:

if (mc.ShowDialog() == DialogResult.OK)

it comes back and says "OK is unrecognized Enum"

Is there some namespace I need to pull in to make these work?

Jan 16 '08 #2
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

No, ar eyou sure u r creating a C# project?
I wondered about that. I'm new to both C# and VS 2008. I set the
settings for C#. It's accepting curly braces in the code where C++
would use a parenthesis.
Jan 16 '08 #3
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

No, ar eyou sure u r creating a C# project?
So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C# also?
Jan 16 '08 #4
doofy wrote:
So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C# also?
C# files are generally .cs, it sounds like your project is a C++ project.

Chris.
Jan 16 '08 #5
..cpp files are C++ files. C# files have a .cs file extension. When you create
the project you have to choose what language you want to use.

"doofy" wrote:
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

No, ar eyou sure u r creating a C# project?

So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C# also?
Jan 16 '08 #6
Adrian wrote:
.cpp files are C++ files. C# files have a .cs file extension. When you create
the project you have to choose what language you want to use.

"doofy" wrote:

>>Ignacio Machin ( .NET/ C# MVP ) wrote:
>>>Hi,

No, ar eyou sure u r creating a C# project?

So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C# also?
I thought I did. A few times. However, I went to my other machine and
created the project, and I've got .cs files now, and the code is working
fine. Sorry for the newbie hiccup.

Jan 16 '08 #7
Hi,

You select the language when you create the project.

Not only that, but IIRC null is also a valid keyword in C++

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Adrian" <Ad****@discussions.microsoft.comwrote in message
news:8B**********************************@microsof t.com...
.cpp files are C++ files. C# files have a .cs file extension. When you
create
the project you have to choose what language you want to use.

"doofy" wrote:
>Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

No, ar eyou sure u r creating a C# project?

So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C# also?

Jan 16 '08 #8
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You select the language when you create the project.

Not only that, but IIRC null is also a valid keyword in C++
Evidently, when my project window was opening for C#, the cursor was way
down in the "Other Languages" area, and I didn't notice. Thus my
blunder. Now I know. Null is still a mystery in C++ then. But it's
working in CS.

Thanks for the help all. It made me start thinking outside the box.
Jan 17 '08 #9
Hi,

"doofy" <no**@notme.comwrote in message
news:47***********************@news.sonic.net...
Ignacio Machin ( .NET/ C# MVP ) wrote:
Evidently, when my project window was opening for C#, the cursor was way
down in the "Other Languages" area, and I didn't notice. Thus my blunder.
Now I know. Null is still a mystery in C++ then. But it's working in CS.
As C# and C++ are both case sensitives you have to use null , in lowercase.
Maybe that was your error all the time

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
Jan 17 '08 #10

"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:ee*************@TK2MSFTNGP04.phx.gbl...
Hi,

You select the language when you create the project.

Not only that, but IIRC null is also a valid keyword in C++
No, it's not. NULL is a symbolic constant for (address) 0, while "nullptr"
is the new C++/CLI keyword which looks like it will be standardized in
C++0x.
>
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Adrian" <Ad****@discussions.microsoft.comwrote in message
news:8B**********************************@microsof t.com...
>.cpp files are C++ files. C# files have a .cs file extension. When you
create
the project you have to choose what language you want to use.

"doofy" wrote:
>>Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

No, ar eyou sure u r creating a C# project?
So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C#
also?


Jan 18 '08 #11
Hi,

My bad, it's been a while since I last touched C++

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Ben Voigt [C++ MVP]" <rb*@nospam.nospamwrote in message
news:uC**************@TK2MSFTNGP02.phx.gbl...
>
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:ee*************@TK2MSFTNGP04.phx.gbl...
>Hi,

You select the language when you create the project.

Not only that, but IIRC null is also a valid keyword in C++

No, it's not. NULL is a symbolic constant for (address) 0, while
"nullptr" is the new C++/CLI keyword which looks like it will be
standardized in C++0x.
>>
--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Adrian" <Ad****@discussions.microsoft.comwrote in message
news:8B**********************************@microso ft.com...
>>.cpp files are C++ files. C# files have a .cs file extension. When you
create
the project you have to choose what language you want to use.

"doofy" wrote:

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

No, ar eyou sure u r creating a C# project?
So, I've specifically set the environment to C#, and I'm getting files
that are generated with the .cpp file type. Does this happen in C#
also?



Jan 18 '08 #12

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

Similar topics

29
by: Jason Curl | last post by:
I've been reading this newsgroup for some time and now I am thoroughly confused over what NULL means. I've read a NULL pointer is zero (or zero typecast as a void pointer), others say it's...
9
by: John Sidney-Woollett | last post by:
Hi I'm building a web app where changes to customer orders are logged in the following table, and I worried about the time that it will take to locate records that need further...
3
by: Tim_Mac | last post by:
hi, i have a master page, and i want to put an asp:literal control in the <head><title> section. but it won't build because it says it's an unrecognized tag prefix. if i put the control inside...
2
by: kens | last post by:
I've found some odd behavior in dynamically loaded user controls under ASP.NET 2.0. Specifically, if I load a control dynamically, in the "Page_Load" event, the code-behind for the user control is...
0
by: Dean N. Williams | last post by:
Dear Python and Mac Community, I have just successfully built gcc version 4.1.0 for my Mac OS X 10.4.6. gcc -v Using built-in specs. Target: powerpc-apple-darwin8.6.0 Configured with:...
2
by: BluNuit | last post by:
I have a simple c# app that calls a Java (AXIS) web service to perform some operations. The call works fine (the java code fires and the operations are executed), but the response is always null. ...
1
by: Luurs | last post by:
Hi All, I've been using a asp-label in the HTML <headsection for quite some time in order to dynamically generate meta-keywords,-description, css and js references. Though the actual...
2
by: Doogie | last post by:
Hi, I'm writing Javascript code to parse out a query string. I want to handle the case where a parameter value may not be sent. So consider a parameter called "State". If the user doesn't pass...
18
by: sanjay | last post by:
Hi, I have a doubt about passing values to a function accepting string. ====================================== #include <iostream> using namespace std; int main() {
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.