473,503 Members | 6,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

null reference exception in VB calling C++ cout

I have a VB .NET program invoking C++ code through a dll. Calling cout
generates "Unhandled Exception: System.NullReferenceException: Object
reference not set to an instance of an object". A line in ostream header
file is causing this error.

I used vbc to build my VB dll. Am I just missing a dll to link in iostream
functions?

#include <iostream>
cout << __FUNCTION__ << " exiting prematurely due to errors\n";

I am new to using VB and .NET. Thank you for any ideas here - I've looked
everywhere for an answer!
Jul 21 '05 #1
1 1508
This was solved by a co-worker:

When we build the C++ dll with /noentry, static variables do not get
initialized, causing problems in std file i/o functions. So, we added
special initializer code to do this, and made some other changes to our link.
See msdn page on /noentry for details.
Jul 21 '05 #2

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

Similar topics

4
4515
by: _ivan | last post by:
Hello, So I think the answer to this question is going to be rather simple. Basically I have a pointer to a class, and I want to have a function to call to initialize it. After this...
5
4463
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#...
2
359
by: Sheri | last post by:
I have a VB .NET program invoking C++ code through a dll. Calling cout generates "Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object". A line...
14
9294
by: Ralf Goertz | last post by:
Hi, this might be intentional, but I don't see a reason, why. Running the program ---------------------- #include <iostream> using namespace std; int main(){
18
2948
by: Denis Petronenko | last post by:
Hello, in the following code i have segmentaion fault instead of exception. Why? What i must to do to catch exceptions in such situation? Used compiler: gcc version 3.3.6 (Debian 1:3.3.6-13) ...
23
7366
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
11
3219
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When...
76
4572
by: valentin tihomirov | last post by:
As explained in "Using pointers vs. references" http://groups.google.ee/group/borland.public.delphi.objectpascal/browse_thread/thread/683c30f161fc1e9c/ab294c7b02e8faca#ab294c7b02e8faca , the...
7
3503
by: Saeed Amrollahi | last post by:
Dear All Hi I have learned when an object is big, I should pass the object using a reference or pointer to it rather than calling by value. In the following code, I don't gain cosiderable...
0
7267
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
7316
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...
1
6976
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...
1
4993
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
4666
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...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.