Re: Can't create Device

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Fredo (fredo68_at_hotmail.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 13:32:23 -0600

I'm sorry, I thought I was fairly clear about why I can't use the debug
runtime:

"Some curious issues I also noticed. I tried to use the Debug build of
DirectX, but then I get a null reference exception in the call to
Manager.Adapters property."

and then again in my second post:

"And why does using the Debug runtime cause Manager.Adapters to return
a null?"

I mean, I suppose for trying to resolve this particular bug, I could remove
the code that depends on Manager.Adapters, but to run the overall system, I
need Manager.Adapters, so the debug build is going to have very limited use
for me in testing my app if Manager.Adapters is always going to return null,
even if I get past this one bug by removing it.

I'm sure this isn't going to be the only DirectX problem I run into.

Pete

"Phil Taylor" <philipt@private-citizen-sorta.com> wrote in message
news:uoaBZFEwEHA.1148@TK2MSFTNGP12.phx.gbl...
> you dont say why you cant use the debug runtime. reconsider. the debug
> runtime is the most single valuable resource to the DX developer. install
> it, turn the debug level up, enable unmanaged debugging, and examine the
> debug runtime OutputDebugString debugging comments in the output pane of
VS.
> that will help.
>
> there is no reason you cant use the D3D initialization code, I do not
> believe there is a licensing issue as long as you make 1 single change.
>
> the reason theirs works and yours doesnt is clearly a bug in your code. we
> are trying to help you debug it by asking questions and helping you thru
the
> process. saying you cant use a major part of the process ( debug runtime )
> does not help your cause.
>
> does any sample use Manager.Adapters? if so, step thru it with the
debugger
> and see what it does in a different code chunk to compare to yours.
>
> "Fredo" <fredo68@hotmail.com> wrote in message
> news:M6Gdnfydp6QY9xvcRVn-sg@giganews.com...
> >I can't use the debug runtime, see the end of my original post regarding
> > that issue.
> >
> > The samples work, but they use a fairly complex initialization within
> > D3DApp.cs in the Common folder. I can't use that in my own code for
> > licensing reasons.
> >
> > So, I guess the two questions are: Why does their's work and why doesn't
> > mine? And why does using the Debug runtime cause Manager.Adapters to
> > return
> > a null?
> >
> > Pete
> >
> > "Phil Taylor" <philipt@private-citizen-sorta.com> wrote in message
> > news:OKqfuJDwEHA.1292@TK2MSFTNGP10.phx.gbl...
> >> do the samples work?
> >>
> >> does the debug runtime provide any debug output to read and chew on?
> >>
> >> can you copy initialization code from the samples and get it to work?
> >>
> >> "Fredo" <fredo68@hotmail.com> wrote in message
> >> news:aridnVJhEqMl_BjcRVn-qQ@giganews.com...
> >> > I'm using DirectX Summer 2003 Update.
> >> >
> >> > When trying to create a Device, I get an InvalidCall exception.
> >> >
> >> > My code is basically:
> >> >
> >> > presParams.BackBufferCount = 1;
> >> > presParams.BackBufferFormat = dgm.Format; // Tried a number of
> > different
> >> > formats here
> >> > presParams.BackBufferWidth = 640;
> >> > presParams.BackBufferHeight = 480;
> >> > presParams.DeviceWindow = parentControl;
> >> > PresentParameters[] ppa = new PresentParameters[1];
> >> > ppa[0] = presParams;
> >> > device = new Device(0,
> >> > DeviceType.Software,
> >> > parentControl,
> >> > CreateFlags.SoftwareVertexProcessing,
> >> > ppa);
> >> >
> >> >
> >> > Now, I've tried passing ppa and presParams as the last parameter. The
> >> > documentation says its an array, but I've seen samples where it's
not.
> >> >
> >> > dgm.Format is one of the formats retrieved from the
> >> > AdapterInfo.SupportedDisplayModes and is either X8R8G8B8 or R5G6B5 on
> >> > my
> >> > machine.
> >> >
> >> > parentControl is a System.Windows.Forms.Form
> >> >
> >> >
> >> > Some curious issues I also noticed. I tried to use the Debug build of
> >> > DirectX, but then I get a null reference exception in the call to
> >> > Manager.Adapters property.
> >> >
> >> > I tried setting other debug options from the DirectX control panel
app,
> >> > such
> >> > as the managed debug stuff, setting all the other debug info on full,
> > but
> >> > I
> >> > don't get any additional information, presumably because I can't use
> >> > the
> >> > debug build of DirectX. I don't know.
> >> >
> >> > Anyway, help on either or both of these issues would be greatly
> >> > appreciated.
> >> >
> >> > Fredo
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Relevant Pages

  • Re: trouble creating array of objects
    ... >> might try refactoring, but I would preserve the original in case I had ... > is debugging as in getting the bugs out, ... it was so badly written that it was effectively impossible to debug. ... The bug ...
    (alt.comp.lang.learn.c-cpp)
  • [IrDA] Oops with NULL deref in irda_device_set_media_busy
    ... I've problems with IrDA - when debug is off, ... The obvious reason is that I don't have irlap module in that inits ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: understanding dependency between dll and vobs
    ... All these dll's are debug versions... ... reason why I can debug them? ... project) being copied in exe directory. ... Visual Studio hanging then it could be some resource file or some other file ...
    (microsoft.public.dotnet.general)
  • Re: Debugging issue to watch variable values
    ... I do not think this document answers my question -- it covers the differences between release version and debug version. ... I think it is a strong reason to debug release version build and debug release version build will cause the issues I mentioned in this thread. ... A reason like "replace binary will impact end users" is not a good reason because stepping through the binary on a production system will usually impact users even more because while debugging the application is stopped completely. ...
    (microsoft.public.vc.language)
  • Re: CreateFileMapping/MapViewOfFile and 0xC0000005 (ACCESS_DENIED)
    ... Debug is Broken, Release is OK. ... is no reason you should not be able to study what is going on in the program. ... The Access Violation occurs within the range of '.text Start'/'.text ... PVOID pMappedFile = NULL; ...
    (microsoft.public.vc.mfc)