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

PRB: System.NullReferenceException

Hi,

Strange, I am having a .Net C++ managed dll project, where in i call a new
on a non managed code. This however is giving a problem,
I get an exception saying "An unhandled exception of type
'System.NullReferenceException' occured in Mydll.dll" "Additional
information: Object reference not set to an instance of an object",

class mycpp
{
}

__gc public class myclass
{
public:
myclass()
{
m_cpp=new m_cpp[10]; // this line gives me the error.
}
private:
mycpp *m_cpp;
}

However i have another test project where i wont get this error. Thats why i
called it as strange.

Please let me know if there is any workaround for this problem.

Thanks
IS.

Nov 17 '05 #1
2 1019
Strange, I am having a .Net C++ managed dll project, where in i call a new
on a non managed code. This however is giving a problem,
I get an exception saying "An unhandled exception of type
'System.NullReferenceException' occured in Mydll.dll" "Additional
information: Object reference not set to an instance of an object",


The unmanaged heap is probably corrupted, and the call to new produces
an access violation exception. Try to test the application with PageHeap,
here is more information about it:
http://tinyurl.com/65xhd

Regards,
Oleg


Nov 17 '05 #2

"ishekara" <is******@ishekara.com> wrote in message
news:d2**********@news.mch.sbs.de...
Hi,

Strange, I am having a .Net C++ managed dll project, where in i call a new
on a non managed code. This however is giving a problem,
I get an exception saying "An unhandled exception of type
'System.NullReferenceException' occured in Mydll.dll" "Additional
information: Object reference not set to an instance of an object",

class mycpp
{
}

__gc public class myclass
{
public:
myclass()
{
m_cpp=new m_cpp[10]; // this line gives me the error.
}
private:
mycpp *m_cpp;
}

However i have another test project where i wont get this error. Thats why
i
called it as strange.

Please let me know if there is any workaround for this problem.

Thanks
IS.


Could you post the real code, the snipet you posted doesn't even compile.

m_cpp=new m_cpp[10]; // THIS CANNOT compile

Willy.

Nov 17 '05 #3

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

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
1
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "An unhandled exception of type 'System.NullReferenceException' occurred in...
1
by: ATS | last post by:
PRB - HttpWebRequest does not work with CGI websites and/or RAW data Please help, I'm trying to make a web deploying UserControl that gets RAW binary data that is dynamically created from a...
2
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
3
by: ATS | last post by:
PRB - UseShellExecute option does not return STD-ERR Please help, I'm using the Process class to start an external process that "may" fail, for all kinds of reasons, but in particular, it may...
1
by: msnews.microsoft.com | last post by:
I'm trying to fill an array of objects but when I add the first object I get a NullReferenceException. ----------------------------------------------------------------------------...
2
by: sxiao | last post by:
Hi, there I got a NullReferenceException when there are more than one users trying to open the same page at the same time. The senerio is: Two users logged into the web application using the...
6
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData ...
3
by: Alex J. | last post by:
I just started to learn C# (my background is in C++), and right now I study the sockets, TCP/IP etc... so, I found a usefull source code at:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
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?
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...

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.