Sun, 09/17/2017 - 16:50
Forums:
Hi! I've got next error on CSharp_D3D sample (prebuilded exe with OCC installation works fine, while manually builded binaries won't work):
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
It happens here:
IDirect3DSurface9* D3dColorSurface() { return myD3dSurf; }
on ResizeBridgeFBO(..) method invocation.
I'm using Win10, VS2017, OCC 7.2.0. DirectX SDK is installed.
Any suggestions? Mby I've missed something important to successfully build D3D project?
Mon, 09/18/2017 - 09:56
It is difficult to guess what can be a reason, considering that pre-built sample works fine on your configuration, but you may check if you are using consistent OCCT+Sample builds
(e.g. using the same source code, using the same parameters, using the same build mode - Release or Debug, etc.),
Mon, 09/18/2017 - 15:51
I'm trying to build Debug and Release x64 with no success.
I guess it is not required to install DirectX SDK, because D3D9.lib is used from my WinSDK (Windows Kits\10\Lib\10.0.15063.0).
I've tried to install DirectX SDK and use $(DXSDK_DIR)Lib\x64 path to include lib from this folder - also no success.
Another interesting point is that my size of OCCTProxy_D3D.dll in release mode is 99KB, while size of pre-built dll is 172KB. I guess d3d9.lib is not linked, because I can delete link pragma and successfuly build solution again - no difference in behaviour.
Later I've found next warning message in my build:
Also I've tried to reinstall opencascade 7.2.0 - no success. I've tried to include <d3d9.h>: build fails on
Platform Toolset v141 (vs2017), Windows SDK version is 10.0.15063.0
Mon, 09/18/2017 - 16:09
I suppose you have built OCCT 7.2.0 using VS2017 by yourself, because official installation package includes only VS2010 builds, which are incompatible with VS2015+?
Mon, 09/18/2017 - 17:23
Right now I've tried to build with VS2015 toolset v140 - no success. It crashes in the same way.
Tue, 09/19/2017 - 09:29
I've built the sample using VS2015 (x64 Debug target) - Visual Studio has automatically upgraded solution -> .NET Framework 4; though it is better switching to 4.5 in project settings due to bugs in older versions of .NET within System.Windows.Interop.D3DImage.
It starts without issues from Visual Studio (msvc_D3D.bat vc14 win64 Debug).
So it should be something in your environment which causes the issue...
Mon, 09/18/2017 - 19:35
Hi Konstantin,
If you are looking for C# solution to development with Opencascade we have advanced OpenCascade wrappers avalaible.
There a 6 assemblies for each occ module:
Our C# wrappers include:
See online demo build with opencacade C# wrappers:
MakeBottle
If you are interested in the C# wrappers , you can contact me at: guidovanhilst at gmail dot com.
Best regards,
Guido