Container class throwing exception in any case
Hi All,
I have been trying to get the managed Directx sample running on my machine. After trying almost endlessly, I am going mad why this always throws exception "Error in the Application" on the initialization of Container object.
The sample comes with the DirectX SDK and the location is Microsoft DirectX SDK (June 2007)\Samples\Managed\Misc\DxDiagOutput. Whenever trying to complie/run the build then it gives the above exception.
Strange part is that MS has also shipped the executable located at \Microsoft DirectX SDK (June 2007)\Samples\Managed\Misc\Bin which runs fine..
Can you please help me in fixing this error.
Pls help.
StackTrace is:
at Microsoft.DirectX.Diagnostics.Container..ctor(Boolean allowWhqlChecks)
at DxDiagOutput.DxDiagDisplay.Main(String[] args) in C:\Program Files\Microsoft DirectX SDK (June 2007)\Samples\Managed\Misc\DxDiagOutput\dxdiag.cs:line 22
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
StackTrace is:
at Microsoft.DirectX.Diagnostics.Container..ctor(Boolean allowWhqlChecks)
at DxDiagOutput.DxDiagDisplay.Main(String[] args) in C:\Program Files\Microsoft DirectX SDK (June 2007)\Samples\Managed\Misc\DxDiagOutput\dxdiag.cs:line 22
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Quote:at Microsoft.DirectX.Diagnostics.Container..ctor(Boolean allowWhqlChecks)
Is the Boolean variable that gets passed into constructor of Container null by any chance?
No,
the value is false. Exception coming at new Container(false).
Here's the code for that:
using System;
using Microsoft.DirectX.Diagnostics;
using Microsoft.DirectX;
namespace DxDiagOutput
{
class DxDiagDisplay
{
static void Main(string[] args)
{
OutputDiagData(null, new Container(false));
}
static void OutputDiagData(string parent, Container root)
{
try
{
foreach (PropertyData pd in root.Properties)
{
Console.WriteLine("{0}.{1} = {2}", parent, pd.Name, pd.Data);
}
}
catch
{
}
try
{
foreach (ContainerData cd in root.Containers)
{
if (parent == null)
OutputDiagData(cd.Name, cd.Container);
else
OutputDiagData(parent + "." + cd.Name, cd.Container);
}
}
catch
{
}
// We are done with this container, we can dispose it.
root.Dispose();
}
}
}
the value is false. Exception coming at new Container(false).
Here's the code for that:
using System;
using Microsoft.DirectX.Diagnostics;
using Microsoft.DirectX;
namespace DxDiagOutput
{
class DxDiagDisplay
{
static void Main(string[] args)
{
OutputDiagData(null, new Container(false));
}
static void OutputDiagData(string parent, Container root)
{
try
{
foreach (PropertyData pd in root.Properties)
{
Console.WriteLine("{0}.{1} = {2}", parent, pd.Name, pd.Data);
}
}
catch
{
}
try
{
foreach (ContainerData cd in root.Containers)
{
if (parent == null)
OutputDiagData(cd.Name, cd.Container);
else
OutputDiagData(parent + "." + cd.Name, cd.Container);
}
}
catch
{
}
// We are done with this container, we can dispose it.
root.Dispose();
}
}
}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement