delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/01/01/03:30:56

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
X-Authentication-Warning: smtp3.ihug.com.au: Host p149-tnt8.syd.ihug.com.au [203.173.147.149] claimed to be acceleron
Message-ID: <001301c1929e$5f4e9c80$0102a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>,
"Andris Pavenis" <pavenis AT lanet DOT lv>, "Robert Hvhne" <robert DOT hoehne AT gmx DOT net>,
"Salvador Eduardo Tropea \(SET\)" <salvador AT inti DOT gov DOT ar>
Cc: <djgpp-workers AT delorie DOT com>
References: <10112311737 DOT AA21576 AT clio DOT rice DOT edu>
Subject: NTVDM Error and TVision.
Date: Tue, 1 Jan 2002 19:28:32 +1100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Reply-To: djgpp-workers AT delorie DOT com

All,

I am trying to find why the Rhide CVS source causes a NTVDM error if I exit
Rhide when it is in a window under XP. I am using Andris's GCC 3.03 snapshot
from early December. I am using TVision 1.1.13. Please note that I am not a
C++ expert and I thought you may be able to give me some pointers as to
where to look next.

I traced the problem to something to do with the destroy() code. I can
reproduce the NTVDM error every time I run the example below in a window
instead of full screen mode. I tried it 10 times in a row and more times
than I can count over the last two days in trying to find the real cause..

The following example (see tvguid01.cc for comment lines removed) shows the
problem or lack of problem depending on what is compiled or commented out.
See below source for further details:
    /*   TVGUID01 Demo Source File                             */

    #define Uses_TApplication
    #include <tv.h>

    class TMyApp : public TApplication
    {
    public:
            TMyApp();
    };

    TMyApp::TMyApp() :
            TProgInit( &TMyApp::initStatusLine, &TMyApp::initMenuBar,
                           &TMyApp::initDeskTop
                         )
    {
    }

    #include <pc.h>
    #include <conio.h>

    int main()
    {
    #if 0            // Change to 1 and app will always crash in window mode
        TMyApp myApp;
        myApp.run();
    #else
        char test[80];

        TMyApp * App;

        App = new TMyApp();
        App->run();
    //    destroy(App);    // Uncomment and app will always crash in window
mode

        sprintf(test,"File: %s %d exit now\n", __FILE__, __LINE__);
        ScreenPutString(test, 07, 1,20);
        getch();
    #endif

        return 0;
    }

Info on what I have found so far:
1) In the source above if I uncomment the "destroy(App);" line of change the
#if 0 to #if 1 to go back to the original code I get a NTVDM error during
the exit stage if I exit the demo if it is in a window. If the example is in
full screen mode then the example exits without any errors occuring.
2) Rhide also causes the NTVDM error to occur on the "destroy(App);" in the
idemain.cc main() function.
3) If I put code in the TApplication::~TApplication() function it gets
executed and the code does not appear to case the NTVDM error.
4) In tvision\include\tv\object.h the definition of destroy is:
    inline void destroy( TObject *o )
    {
      if (o)
      {
        o->shutDown();
        delete o;
      }
    }
5) I ran the seteditor in a window and it also produced a NTVDM on exit.

I am stumped as to where to look next as it now looks like a needle in a
haystack problem and I am not familiar with this haystack. Any ideas anyone?

Andrew





- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019