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

C++/CLI how to assign null?

Hey,

How can I assign 'null' value to a handle in C++/CLI?
I searched for this for some while now, finding nothing so far.

In C# I could write:

something = null;

or

if ( something == null ) ...

However, C++/CLI does not understand null. NULL is not defined, and it
shouldn't be. Also, in Managed C++ I could use 0 instead of null, but that
doesn't work either anylonger.

So, anyone has a solution? :-)

Thanks
-Lenard
Nov 17 '05 #1
2 23961
Lenard Gunda wrote:
Hey,

How can I assign 'null' value to a handle in C++/CLI?
I searched for this for some while now, finding nothing so far.

In C# I could write:

something = null;

or

if ( something == null ) ...

However, C++/CLI does not understand null. NULL is not defined, and it
shouldn't be. Also, in Managed C++ I could use 0 instead of null, but
that doesn't work either anylonger.

So, anyone has a solution? :-)


nullptr

-cd
Nov 17 '05 #2
Hi,

In C++/CLI, just write :

something = nullptr;
if (!something)
if (something == nullptr)

Geoffroy

"Lenard Gunda" <ar**************@vipmail.hu> wrote in message
news:eq**************@TK2MSFTNGP12.phx.gbl...
Hey,

How can I assign 'null' value to a handle in C++/CLI?
I searched for this for some while now, finding nothing so far.

In C# I could write:

something = null;

or

if ( something == null ) ...

However, C++/CLI does not understand null. NULL is not defined, and it
shouldn't be. Also, in Managed C++ I could use 0 instead of null, but that
doesn't work either anylonger.

So, anyone has a solution? :-)

Thanks
-Lenard

Nov 17 '05 #3

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

Similar topics

5
by: Vishal Sinha | last post by:
Here is my issue. I have a list of merchants (generated daily) and I need to assign them eually to a set of analysts. Both the merchant list and analyst list can change daily. I want to assign each...
10
by: John | last post by:
Ok. I'm not sure whether this is cool or perverted, I need second opinion ;) I define two classes as follows: /********************************************/ public sealed class Dummy {...
3
by: vince | last post by:
I want to assign a null value to a DateTime variable.How do i do that? Thanks Vince
3
by: Prabhudhas Peter | last post by:
I want to assign null value to a column in the database which is decalred as an integer from VB.net... Is there any specific keyword like vbNull as in vb 6.0. -- Peter...
2
by: Jim McGivney | last post by:
In asp 2.0 I am trying to insert a row using a detailsview control connected to an accessDataSource. I get the error message below. I am having trouble identifing which data field is causing the...
11
by: MLH | last post by:
I have 2 lines in a procedure that assign MyVariant a value - line #238 and line #491. When line #238 runs, the value is 152. When line #491 runs, the DLookup function returns Null. I would expect...
3
by: Liam Mac | last post by:
Hi All, Can anyone direct me or provide advice on how I can assign a null value to a date variable in vb.net. Basically what I'm doing is that I'm looping through a recordset where I have three...
11
by: skumar434 | last post by:
Hi everybody, I am faceing problem while assigning the memory dynamically to a array of structures . Suppose I have a structure typedef struct hom_id{ int32_t nod_de; int32_t hom_id;
1
by: susan.fitzpatrick | last post by:
In C# integers are automatically intialized to zero. I need to assign null to an integer (i.e. int i = null). I cannot use Nullable Types because that is a feature in .NET 2.0 and I need to use...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...
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
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.