Add member function in OpenCASCADE original class

I use Visual C++ 6.0
I want to add data member and member function in the OpenCASCADE original class;
Here is my code.

class Geom_BSplineSurface : public Geom_BoundedSurface
// original code...

// add data member SubBS[2] to store the surfaces
// Split from "this"
Handle(Geom_BSplineSurface) SubBS[2];

// add member function to Generate BSpline
// surfaces for SubBS[2]


void Geom_BSplineSurface::GenerateSubBS()
SubBS[0] = GeomConvert::SplitBSplineSurface
(this, 1, int(NbUPoles()/2), 1, NbVPoles());

Compiling is ok, but it can't be execute. I uesd DeBug to check it out.
The member function
"Geom_BSplineSurface::GenerateSubBS()" I add doesn't work.
error messege pop up:
" Unhandled exception in XXX.exe(KERNEL32.DLL):0xE06D7363:Microsoft C++ Exception "

The declaration of GeomConvert::SplitBSplineSurface

static Handle(Geom_BSplineSurface) SplitBSplineSurface
(const Handle(Geom_BSplineSurface)& S,
const Standard_Integer FromUK1,
const Standard_Integer ToUK2,
const Standard_Integer FromVK1,
const Standard_Integer ToVK2,
const Standard_Boolean SameUOrientation
= Standard_True,
const Standard_Boolean SameVOrientation
= Standard_True);

I'm not familiar with "Handle". Maybe it's the point.
please~ thanks.

Kreshnik's picture


I think you must create a new class, which inherits from Geom_BSplineSurface. And then you add your data members.