LoginSignup
0
0

More than 5 years have passed since last update.

C++ Builder XE4 > TeeChart > メモリエラー 「モジュール 'Tee9180.bpl'のアドレスXXXXでアドレスYYYYに対する読み取り違反がおきました。」 > Series1にデータ点がない時にXValues->Last()をコールするとエラー

Last updated at Posted at 2018-10-24
動作環境
C++ Builder XE4
TeeChart Lite v2013.08.130414 32bit VCL

メモリエラー

Unit1.cpp
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include <DateUtils.hpp>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    TDateTime dt;

    dt = Series1->XValues->Last();

    int nop=1; // for breakpoint
}
//---------------------------------------------------------------------------

2018-10-24_16h09_55.png

モジュール 'Tee9180.bpl'のアドレスXXXXでアドレスYYYYに対する読み取り違反がおきました。

発生条件と対処案

  • Series1に点がない
  • XValues->Last()をコール

XValues->Last()をコールする前にXValues->Countが0でないかのチェックなどが必要。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0