Error creating OpenGL control in wpf window on windows 7

I created an OpenGL control in C ++ and want to use it in a WPF application. I successfully did this and it works fine on Vista and XP machines, but when I open my project on a Windows 7 machine, the WPF design window will not be displayed. When I try to run the program, I get an exception:

"It is not possible to create an instance of 'Window1' defined in the assembly 'LabUserInterface, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null'. The exception was caused by the call purpose. Error in the markup file 'Window1. Xaml' Line 1 Position 9."

"LabUserInterface" is the place where my OpenGL stuff lives. I also have this error in a WPF window:

"Type" MS.Internal.Permissions.UserInitiatedNavigationPermission 'in Assembly' PresentationFramework, Version = 3.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 'is not marked as serializable. "

+6
c ++ windows-7 wpf opengl
source share
3 answers

Two possibilities:

1) UAC, a problem with processing, a problem with the dependency channel, .NET security, or some other problems with permissions (possibly executed as an administrator) for testing. Or make sure your assembly is visible to all dependencies and the correct permissions (for example, private if in bin folders or next to the application, public if in gac or outside the application space).

2) Also make sure you can run OpenGL in the win7 window. It may be a video driver or something trying to list video profiles on a map. Update your graphics card drivers. If you are using a generic version of OpenGL, make sure it is present on the computer.

I know that when you create a C ++ control in .NET, security issues are a major concern. Make sure that your C ++ control is visible in the opengl DLLs (if used together) and that they are in the download path (all of them can be deleted in C: \ windows \ system32, if all else cannot be sure that they can be seen either locally in the private assembly (bin)).

We had the same problem with the image toolkit for PVR, and it turned out that one DLL was not in the dependency path. A good tool is DependencyWalker for checking: http://dependencywalker.com/

+2
source share

Thanks Ryan, the walking walking assistant. It turns out that I need glut32.dll in the debug folder for the WPF project, and this is something that I do not require on other machines.

0
source share

I do not think your permission error has anything to do with OpenGL. Perhaps this generated an attempt to collect information about a real error (which would explain the attempt to use a serializer). Try commenting on all the insides of your user control so that it simply inherits from the base class and retries (well, you may need to leave some property definitions). If this is fixed, add the implementation back slowly until you highlight the cause of the problem.

If this still fails, then what you probably want to do is open one copy of Visual Studio and use it to debug a second copy of Visual Studio with an open project in the WPF designer. You can then break the exception, view the variables up and down the call stack, and usually fix the problem.

Do you have the same version of Visual Studio and the same patches on production and non-working environments? Visual Studio patch creates this problem much more often than the base OS. With OpenGL, a video driver can also be important, so post this info.

-one
source share

All Articles