Thread: Newbie Question, can anyone help?

  1. #1
    Unregistered
    Guest

    Newbie Question, can anyone help?

    Ok, I have Borland's C++ 3.1.... I'm pretty much new to C++... but i know some other languages... well, while messinga round with the Turbo Vision demos that came with it, I tried to run one of them and I get this....

    Compiling TEST.CPP:
    Fatal ..\INCLUDE\TV.H 16: Error directive: TV needs the large memory model

    any clue what that means?

    Thanks,

    Jon Scott

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Fatal ..\INCLUDE\TV.H 16: Error directive: TV needs the large memory model
    For some reason I find this funny. But seriously, did you write this header yourself and then surround it with < >? If so the compiler may not be able to find it, user defined header files should use double quotes instead of angle brackets:

    #include "tv.h"

    -Prelude
    My best code is written with the delete key.

  3. #3
    Unregistered
    Guest

    lol....

    lol nope.... didint work... here si the complete file.... I don't even know what its supposed to do lol... oh btw at first I was having some problems with it couldent find the tv.h file, so I was like... ok well i took it out to the tv folder and puty in in with the rest of the include files, lol and the error went away... but now that TV large memory blah blah error pops up lol.....









    /*----------------------------------------------------------*/
    /* */
    /* Turbo Vision 1.0 */
    /* Copyright (c) 1991 by Borland International */
    /* */
    /* Ascii.cpp: Member functions of following classes: */
    /* TTable */
    /* TReport */
    /* TAsciiChart */
    /*----------------------------------------------------------*/

    #define Uses_TRect
    #define Uses_TEvent
    #define Uses_TKeys
    #define Uses_TDrawBuffer
    #define Uses_TStreamableClass
    #define Uses_TStreamable
    #define Uses_TView
    #define Uses_TWindow
    #include <tv.h>
    __link( RView )
    __link( RWindow )

    #include <string.h>
    #include <stdlib.h>
    #include <ctype.h>
    #include <strstrea.h>
    #include <iomanip.h>

    #include "ascii.h"


    //
    // TTable functions
    //

    const char * const TTable::name = "TTable";


    void TTable::write( opstream& os )
    {
    TView::write( os );
    }


    void *TTable::read( ipstream& is )
    {
    TView::read( is );
    return this;
    }


    TStreamable *TTable::build()
    {
    return new TTable( streamableInit );
    }


    TStreamableClass RTable( TTable::name,
    TTable::build,
    __DELTA(TTable)
    );


    TTable::TTable(TRect& r) :
    TView( r )
    {
    }


    void TTable::draw()
    {
    TDrawBuffer buf;
    char color = getColor(6);

    for(int y = 0; y <= size.y-1; y++)
    {
    buf.moveChar(0, ' ', color, size.x);
    for(int x = 0; x <= size.x-1; x++)
    buf.moveChar(x, 32*y+x, color, 1);
    writeLine(0, y, size.x, 1, buf);
    }
    showCursor();
    }

    //
    // cmCharFocused is a offset value (basically the ascii code of the
    // current selected character) thus should be added, not or'ed, to
    // cmAsciiTableCmdBase.
    //

    void TTable::charFocused()
    {
    message(owner, evBroadcast, cmAsciiTableCmdBase + cmCharFocused,
    (void *) (cursor.x + 32 * cursor.y));
    }


    void TTable::handleEvent(TEvent& event)
    {
    TView::handleEvent(event);

    if (event.what == evMouseDown)
    {
    do
    {
    if(mouseInView(event.mouse.where))
    {
    TPoint spot = makeLocal(event.mouse.where);
    setCursor(spot.x, spot.y);
    charFocused();
    }
    } while (mouseEvent(event, evMouseMove));
    clearEvent(event);
    }
    else
    {
    if (event.what == evKeyboard)
    {
    switch (event.keyDown.keyCode)
    {
    case kbHome:
    setCursor(0,0);
    break;
    case kbEnd:
    setCursor(size.x-1, size.y-1);
    break;
    case kbUp:
    if (cursor.y > 0)
    setCursor(cursor.x, cursor.y-1);
    break;
    case kbDown:
    if (cursor.y < size.y-1)
    setCursor(cursor.x, cursor.y+1);
    break;
    case kbLeft:
    if (cursor.x > 0)
    setCursor(cursor.x-1, cursor.y);
    break;
    case kbRight:
    if (cursor.x < size.x-1)
    setCursor(cursor.x+1, cursor.y);
    break;
    default:
    setCursor(event.keyDown.charScan.charCode % 32,
    event.keyDown.charScan.charCode / 32);
    break;
    }
    charFocused();
    clearEvent(event);
    }
    }
    }


    //
    // TReport functions
    //

    const char * const TReport::name = "TReport";


    void TReport::write( opstream& os )
    {
    TView::write( os );
    os << asciiChar;
    }


    void *TReport::read( ipstream& is )
    {
    TView::read( is );
    is >> asciiChar;
    return this;
    }


    TStreamable *TReport::build()
    {
    return new TReport( streamableInit );
    }


    TStreamableClass RReport( TReport::name,
    TReport::build,
    __DELTA(TReport)
    );


    TReport::TReport(TRect& r) :
    TView(r)
    {
    asciiChar = 0;
    }


    void TReport::draw()
    {
    TDrawBuffer buf;
    char color = getColor(6);
    char str[80];
    ostrstream statusStr( str, sizeof str );

    statusStr
    << " Char: " << ((asciiChar == 0) ? (char) 0x20 : (char) asciiChar)
    << " Decimal: " << setw(3) << (int) asciiChar
    << " Hex " << hex << setiosflags(ios::uppercase)
    << setw(2) << (int) asciiChar << " " << ends;

    buf.moveStr(0, str, color);
    writeLine(0, 0, 32, 1, buf);
    }


    void TReport::handleEvent(TEvent& event)
    {
    TView::handleEvent(event);
    if (event.what == evBroadcast)
    {
    if (event.message.command == cmAsciiTableCmdBase + cmCharFocused)
    {
    asciiChar = event.message.infoLong;
    drawView();
    }
    }
    }


    //
    // TAsciiChart functions
    //

    const char * const TAsciiChart::name = "TAsciiChart";


    void TAsciiChart::write( opstream& os )
    {
    TWindow::write( os );
    }


    void *TAsciiChart::read( ipstream& is )
    {
    TWindow::read( is );
    return this;
    }


    TStreamable *TAsciiChart::build()
    {
    return new TAsciiChart( streamableInit );
    }


    TStreamableClass RAsciiChart( TAsciiChart::name,
    TAsciiChart::build,
    __DELTA(TAsciiChart)
    );


    TAsciiChart::TAsciiChart() :
    TWindow(TRect(0, 0, 34, 12), "ASCII Chart", wnNoNumber),
    TWindowInit( &TAsciiChart::initFrame )
    {
    TView *control;

    flags &= ~(wfGrow | wfZoom);
    palette = wpGrayWindow;

    TRect r = getExtent();
    r.grow(-1, -1);
    r.a.y = r.b.y - 1;
    control = new TReport( r );
    control->options |= ofFramed;
    control->eventMask |= evBroadcast;
    insert(control);

    r = getExtent();
    r.grow(-1, -1);
    r.b.y = r.b.y - 2;
    control = new TTable( r );
    control->options |= ofFramed;
    control->blockCursor();
    insert(control);

    control->select();
    }

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Okay, to limit confusion you want to keep your self written headers out of the INCLUDE directory of the standard files. So take tv.h and place it in the same directory as the executable and in your code use

    #include "tv.h"

    And see how that works. Usually the problem is that the header is in a different directory from what the include directive is looking in.

    -Prelude
    My best code is written with the delete key.

  5. #5
    Unregistered
    Guest
    Alright, I put all the tv files into the bin directory.. and it finds tv.h fine... but still the same error.... heres where the error is coming from

    /* ------------------------------------------------------------------------*/
    /* */
    /* TV.H */
    /* */
    /* Copyright (c) Borland International 1991 */
    /* All Rights Reserved. */
    /* */
    /* ------------------------------------------------------------------------*/

    #pragma option -Vo-
    #if defined( __BCOPT__ )
    #pragma option -po-
    #endif

    #ifndef __LARGE__
    #error TV needs the large memory model
    #endif

    #define _TV_VERSION 0x0103


    lol... gotta love bein a begennier lol...

    Thanks again!

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    That looks very implementation defined, try looking at the help files for the compiler about that error. That would probably be able to help better than I.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 06:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 04:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM