C# example in .Net 2.0 environment

Hi,

I'm new to OpenCascade and
try to run the C# IE example with C#.NET 2.0. Unfortunatly I get a error message "loader lock detected". Everything works fine if I run the example in VS 2003, but after upgrading the solution to VS 2005 I get this "loader lock" message.
Does anybody have experience with OpenCascade and .NET 2.0?

bfehse's picture

Hi,

in the meantime I found a solution. For anybody interested:
The project containing the nativ dll (OCC.cpp) defines a function DllMain as a entry point. It seems that this causes the "loader lock". As far as I understood the posts in some C# forums this used to be necessary to prevent a loader lock in .NET 1.0 and 1.1. In 2.0 You should just have to comment this function out and everything works fine.

Best regards

Björn

Jonathan Hill's picture

Hi,

Something which you may be interested in if you are looking at developing in C#, I have wrapped (but not using P/Invoke) some of the OCC API classes at a starter and would like to continue this.

Jonathan

bfehse's picture

Hi Jonathan,

that sounds interesting. I did write a managed C++ wrapper for some OCC API, so I think You do something similar. I use OCC to impent STEP import and data exchange, so I'm not using a big part of the API at the moment, but that might change.

Regards

Björn

Gerhard Hofmann's picture