A nullptr exception is thrown in the STEPCAFControl_Reader::Transfer() function

[Code]:

LoadSTEPFormatWithXDE(CString pathSTEP)
{
    STEPCAFControl_Reader sReader;

    sReader.SetColorMode(true);
    sReader.SetNameMode(true);
    sReader.SetLayerMode(true);

    IFSelect_ReturnStatus status = sReader.ReadFile((CStringA)pathSTEP);

    if (status != IFSelect_RetDone)
    {
        AfxMessageBox(_T("Load Fail!!"));
        return;
    }

    sReader.Transfer(m_DataDoc); // <------ here
        ... ... 
}

[CallStack]:

TKLCAF.dll!TDocStd_Document::Main() 줄 159   C++
TKXCAF.dll!XCAFDoc_DocumentTool::SetLengthUnit(const opencascade::handle<TDocStd_Document> & theDoc, const double theUnitValue, const UnitsMethods_LengthUnit theBaseUnit) 줄 510    C++
TKXDESTEP.dll!STEPCAFControl_Reader::prepareUnits(const opencascade::handle<StepData_StepModel> & theModel, const opencascade::handle<TDocStd_Document> & theDoc) 줄 555 C++
TKXDESTEP.dll!STEPCAFControl_Reader::Transfer(STEPControl_Reader & reader, const int nroot, opencascade::handle<TDocStd_Document> & doc, NCollection_Sequence<TDF_Label> & Lseq, const bool asOne, const Message_ProgressRange & theProgress) 줄 576 C++
TKXDESTEP.dll!STEPCAFControl_Reader::Transfer(opencascade::handle<TDocStd_Document> & doc, const Message_ProgressRange & theProgress) 줄 437 C++

[exception position]:

TDF_Label TDocStd_Document::Main () const
{ 
  return  myData->Root().FindChild(1,Standard_True);
}
message : this(pointer) is nullptr.
J.W.Kim's picture

I know.

missing code:

new TDocStd_Application();
App->NewDocument(... , ... );

ㅠㅠ Sorry.