I’m trying to build a C++ plug-in for 64 bits. This plug-in contains some managed C++ code.
When I try to run its 64 bits version, I get the following message (approximately translated from french) …
The debugging managed assistant 'LoaderLock' has detected a problem in 'C:\Program Files\Rhinoceros 5.0 WIP (64-bit)\System\Rhino.exe'.
Additional informations : the DLL 'C:\Users\...\MyPlugin.rhp' attempts a managed execution in the lock of OS loader. Don't try to execute managed code in an init function or in DllMain, because it can block the application.
My plug-in project is configured with CLR support; by default, sources are compiled with /clr. Pure C++ sources are compiled without /clr (I set the property for each pure C++ source).
The 32 bits version of this plug-in runs successfully.
Do I need extra stuffs to mix managed and unmanaged C++ with Rhino 5 - 64 bits ?
Help me understand why you want to develop a mixed mode C++ plug-in for Rhino? Why not develop a true .NET plug-in, using either C# or Visual Basic, using RhinoCommon?
As a side note, none of the plug-ins shipped with Rhino are mixed-mode C++. If fact, I’ve never even tried to build this type of plug-in. It may be possible - I’m sure it’s painful.
Anyway, more information in what you are trying to do and why would be helpful.
I must develop in C++ as I do an intensive use of C++ libs (mostly boost libs).
So, my choice would rather be to develop a true C++ plug-in.
The managed C++ code I have is only for GUI (dialog windows) as GUI development with MFC is really painful to me (especially for dynamic dialog windows).
I’m afraid I’ll have to migrate my GUIs to C++. Maybe using CRhinoUi* classes…
Well there is a much easier way to do this than using mixed mode C++. Its possible to developer UI in C# and call it from C++ - even Rhino does this. I’ll work up a sample you if you want.
I’d be interested in such a sample too. I’ve been struggling with this and may have a solution that is overly complicated. I’m curious to see how you guys do this
The recommended approach is to create your plug-in in C# and have the UI in your plug-in. The C# plug-in would then call into a C++ DLL library. Here’s a related port on the topic