Sign in to follow this  
gamchi

Container class throwing exception in any case

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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()

Share this post


Link to post
Share on other sites
Quote:
at Microsoft.DirectX.Diagnostics.Container..ctor(Boolean allowWhqlChecks)


Is the Boolean variable that gets passed into constructor of Container null by any chance?

Share this post


Link to post
Share on other sites
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();
}
}
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this