Original Post
Hi there ! (and happy new year :p) I have trouble using NVPerfHUD recently. Here is my "setup" : Win7 32 bits, the project is in managed C++ (with /clr) and using a pure C++ .lib. In the project, I create a form, in this form I add a panel which I use to create my D3D device, and render. My graphic card is a GTX 285 and I use the 195.62 NVidia drivers. I've been working on this project for quite a long time, and been using NVPerfHUD from the beginning. But recently I started to have troubles. First, a few months ago, the NVidia drivers were causing a bug and making NVPerfHUD to crash. And then, each time I tries to use it, I have an exception with this message : (sorry for the french message ... hope there are some infos you might use ...) Basically, it says that if failed registering for DragAndDrop ... and I should mark my main function with [STAThread]. But it's already the case. The NVPerfHUD samples works fine (whereas with the driver problem they weren't) and the problem also occurs on WinXP. So, is there any known problem with using NVPerfHUD on C++/CLR projects ? Any idea on what might cause this exception ? And a solution to correct it ? Thx in advance for any help. Edit: ok, a quick edit to say that I was using the latest NVPerfHUD (6.6) and as I didn't know what to do, I tried earlier versions ... it works fine with 6.1. I'm trying 6.5 now ... Edit2: works with 6.51. So that's probably a bug with 6.6 ... I hope it will be corrected in the next release. [Edited by - paic on January 6, 2010 9:58:47 AM]
Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.
************** Texte de l'exception **************
System.InvalidOperationException: Échec de l'inscription DragDrop. --->
System.Threading.ThreadStateException: Le thread actuel doit être en mode
STA (Single Thread Apartment) avant que des appels OLE puissent être effectués.
Assurez-vous que votre fonction Main est marquée comme STAThreadAttribute.
à System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
--- Fin de la trace de la pile d'exception interne ---
à System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)
à System.Windows.Forms.Control.OnHandleCreated(EventArgs e)
à System.Windows.Forms.Control.WmCreate(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à WeifenLuo.WinFormsUI.Docking.DockPaneStripBase.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Assemblys chargés **************
mscorlib
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3603 (GDR.050727-3600)
CodeBase : file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
AMEditor - Release - NVPerfHUD
Version de l'assembly : 1.0.3658.21178
Version Win32 :
CodeBase : file:///D:/SVN/DEV/AMEngine/AMEditor/bin/AMEditor%20-%20Release%20-%20NVPerfHUD.exe
----------------------------------------
msvcm90
Version de l'assembly : 9.0.30729.4148
Version Win32 : 9.00.30729.4148
CodeBase : file:///C:/WINDOWS/WinSxS/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_d495ac4e/msvcm90.dll
----------------------------------------
System.Windows.Forms
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase : file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase : file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase : file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
IToolPanel
Version de l'assembly : 1.0.0.0
Version Win32 : 1.0.0.0
CodeBase : file:///D:/SVN/DEV/AMEngine/AMEditor/bin/IToolPanel.DLL
----------------------------------------
WeifenLuo.WinFormsUI.Docking
Version de l'assembly : 2.3.1.26519
Version Win32 : 2.3.1.0
CodeBase : file:///D:/SVN/DEV/AMEngine/AMEditor/bin/WeifenLuo.WinFormsUI.Docking.DLL
----------------------------------------
System.Xml
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3082 (QFE.050727-3000)
CodeBase : file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Windows.Forms.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase : file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
ZedGraph
Version de l'assembly : 5.1.2.878
Version Win32 : 5.1.2.878
CodeBase : file:///D:/SVN/DEV/AMEngine/AMEditor/bin/ZedGraph.DLL
----------------------------------------
mscorlib.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.3603 (GDR.050727-3600)
CodeBase : file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.
Par exemple :
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.