null reference exception in VB calling C++ cout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sheri

    #1

    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.NullRefe renceException: 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!
  • Sheri

    #2
    RE: null reference exception in VB calling C++ cout

    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.

    Comment

    Working...