For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Using OpenCascade in a DLL

Gabriele De Agostini's picture
Forums: 

Hi,

we're writing a module that uses OpenCascade 7.2 in a dynamic loaded DLL.

This module simply reads a STEP or IGES using STEPCAFControl_Reader and IGESCADControl_Reader.

All works but unloading DLL I have an Unhandled exception (Access violation) in

     TKXSBase.dll!StepData_GlobalNodeOfWriterLib::~StepData_GlobalNodeOfWriterLib()    C++
     TKXSBase.dll!StepData_GlobalNodeOfWriterLib::`scalar deleting destructor'(unsigned int)    C++
     TKXSBase.dll!StepData_GlobalNodeOfWriterLib::~StepData_GlobalNodeOfWriterLib()    C++
     TKXSBase.dll!StepData_GlobalNodeOfWriterLib::`scalar deleting destructor'(unsigned int)    C++
     TKXSBase.dll!`dynamic atexit destructor for 'theglobal''()    C++
>    TKXSBase.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 416    C
     TKXSBase.dll!__DllMainCRTStartup(void * hDllHandle=0x00007ffce46a0000, unsigned long dwReason=0, void * lpreserved=0x00000056e81fea80) Line 522    C

it happens everytime I declare an object STEPCAFControl_Reader or IGESCAFControl_Reader. It happens also if the only code executed by DLL is a declaration like

STEPCAFControl_Reader reader;

Same code in an EXE works fine without problem.

Someone have an Idea?

I attached wizard generated solution (Vs 2012) to test it.

Thank you

Attachments: 
Boris Sunik's picture

Hi,

We have exactly the same problem. Any suggestions were appreciated