Container class throwing exception in any case

Started by
4 comments, last by gamchi 16 years, 8 months ago
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.
Advertisement
Just to add, this is related to the Microsoft.DirectX.Diagnostics namespace..
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()
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();
}
}
}
I don't know why I am not receiving any response for this problem. Though, I have figured out to collect the system information by other means still I am hoping that some one will be generous enough to look into this stupid problem and help me out.

This topic is closed to new replies.

Advertisement