473,725 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NULL in managed C++

Hello,

I am working on a Windows Forms Control Library which has some
unmanaged code in it. What is the equivalent of "C# null" in managed
C++?

CUnmanagedClass *pClass = NULL;
ManagedClass^ aClass = ?;

I want to check if aClass has been set.
Thank you!

Jan 11 '07 #1
2 22134

"Bumbala" <bu*****@gmail. comwrote in message
news:11******** **************@ p59g2000hsd.goo glegroups.com.. .
Hello,

I am working on a Windows Forms Control Library which has some
unmanaged code in it. What is the equivalent of "C# null" in managed
C++?
nullptr, which is a new keyword in C++/CLI, but about to be included into
Standard C++.
>
CUnmanagedClass *pClass = NULL;
ManagedClass^ aClass = ?;

I want to check if aClass has been set.
Thank you!

Jan 11 '07 #2
Thank you :)

Ben Voigt wrote:
"Bumbala" <bu*****@gmail. comwrote in message
news:11******** **************@ p59g2000hsd.goo glegroups.com.. .
Hello,

I am working on a Windows Forms Control Library which has some
unmanaged code in it. What is the equivalent of "C# null" in managed
C++?

nullptr, which is a new keyword in C++/CLI, but about to be included into
Standard C++.

CUnmanagedClass *pClass = NULL;
ManagedClass^ aClass = ?;

I want to check if aClass has been set.
Thank you!
Jan 12 '07 #3

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

Similar topics

1
3598
by: SSRoy | last post by:
I cant use the NULL constant to check a pointer (eg. say Object*) whether it is valid or not - when I use C++ .NET. What comes in place of NULL in the managed extension of C++ Pls Help. Sincerely Sanjoy Sinharoy
7
7181
by: Dirk Reske | last post by:
Hello, if I have a P/Invoke method: open(STRUCT1 str, STRUCT2 str2); is there a way to pass <null> for a struct in C#? How can I solve this? thx
16
3752
by: Stefan Hong | last post by:
Hi, It seems that the way reflection resolves methods is not quite the same as default CLR. For example this simple class: class Test { public void Hello(string name) { Console.WriteLine("Hello(string)"); } public void Hello(object obj) {
4
1999
by: Joey | last post by:
Hi, I have come across codes like this if(dbConn != null) { dbConn.dispose(); } and sometimes like
5
4472
by: Niall | last post by:
I have an unmanaged C++ ray tracer which I am working to put a C# front end on. It runs fine as just the unmanaged code. I have made a MC++ wrapper DLL to expose the required types to the C# project. Things seem to be getting through from the unmaged side to the managed side - the image is being rendered correctly. However, at random points, calls to new are returning null. Hence, when the managed type gets destroyed and calls delete on its...
27
4214
by: David W | last post by:
I'm almost tearing my hair out. A colleague claimed that a null reference can exist, like this: void f( int& p ) { printf( "%d\n", p ); } int main (int argc, char *argv) {
7
4869
by: Robin Imrie | last post by:
Hi, I have some code like this.... MyObject ^o = gcnew MyObject(); My2ndObject ^obj2 = o->GetObject(); if( obj2 != NULL ) {
1
1727
by: connor7777 | last post by:
Hi guys: We've been weeding out errors off of a java->c# project and have managed to redeem most of our code with the exception of one bug that we for some reason cannot pin down. The following is an implementation of Linked List class for any item "E" (that also implements IMatchable for itself). It defines "LinkedList" as a recursive datatype with no separate "Cell" or "Node" class, much the same as say for instance ML's Programming...
4
2483
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code m_Token = null in order to destroy the session token when the user logs out. However, I'm finding that setting class instance to null results in no header being sent back to the client, with the result that the client actually remains with an...
0
8878
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8749
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
9398
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...
0
9250
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9165
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
6006
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3216
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
2626
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2153
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.