Piping problem. EOSError: System Error. Code: -1073283066. ?

Discussion in 'Windows 64bit' started by Skybuck Flying, Sep 24, 2009.

  1. Batchfile:

    "GPGPUBasicMathTutorial.exe 1 rect_arb_rgba_32 0 1000000 100 > Test.txt"

    Test.txt:
    program started
    TEXRECT - float_ARB - RGBA - 32
    , N=1000000, numIter=100
    CreateDC successfull.
    EOSError: System Error. Code: -1073283066.

    WTF ?!

    Bye,
    Skybuck.
     
    Skybuck Flying, Sep 24, 2009
    #1
    1. Advertising

  2. Apperently the gpgpu math tutorial example only works when running inside
    delphi...

    When trying to run it from command line in dos prompt the same happens:

    Z:\Delphi\Tests\test GPGPU Basic Math Tutorial\version 0.02 get it
    working>GPGPU
    BasicMathTutorial.exe 1 rect_arb_rgba_32 0 1000000 100
    program started
    TEXRECT - float_ARB - RGBA - 32
    , N=1000000, numIter=100
    CreateDC successfull.
    EOSError: System Error. Code: -1073283066.

    Probably related to trying to get a console device context, setting
    rendering context and pixel format.

    Code from microsoft was:

    (Slightly modified by me)

    function GetConsoleWindowHandle : HWND;
    const
    vMaximumTitleSize = 1024;

    var
    vOldWindowTitle : AnsiString;
    vNewWindowTitle : AnsiString;
    begin
    // allocate space for old window title.
    SetLength( vOldWindowTitle, vMaximumTitleSize );

    // fetch current window title.
    GetConsoleTitle( PAnsiChar(vOldWindowTitle), vMaximumTitleSize);

    // format a "unique" NewWindowTitle.
    vNewWindowTitle := IntToStr(GetTickCount()) +
    IntToStr(GetCurrentProcessId());

    // change current window title.
    SetConsoleTitle(PAnsiChar(vNewWindowTitle));

    repeat
    // might cause some high cpu usage here... but on fast pc's it seems to
    // not do that... don't know about w95 so test it there sometime or so ;)
    // otherwise add a sleep(40) here or so ;)
    // but for now I let it be... prevents title flicker ! ;) :)

    // Look for NewWindowTitle.
    result := FindWindow( nil, PAnsiChar(vNewWindowTitle));
    until result <> 0;

    // Restore original window title.
    SetConsoleTitle(PAnsiChar(vOldWindowTitle));

    // free space for old window title
    vOldWindowTitle := '';
    end;


    Also create rendering context is probably where the error occurs:


    from opengl library (my up key just stopped working ? wow weird shit
    happening):

    Ok now it works again... weird.

    function CreateRenderingContext(DC: HDC; Options: TRCOptions; ColorBits,
    ZBits, StencilBits, AccumBits, AuxBuffers: Integer; Layer: Integer): HGLRC;
    const
    OBJ_MEMDC = 10;
    OBJ_ENHMETADC = 12;
    OBJ_METADC = 4;
    PFD_DOUBLEBUFFER = $00000001;
    PFD_STEREO = $00000002;
    PFD_DRAW_TO_WINDOW = $00000004;
    PFD_DRAW_TO_BITMAP = $00000008;
    PFD_SUPPORT_GDI = $00000010;
    PFD_SUPPORT_OPENGL = $00000020;
    PFD_TYPE_RGBA = 0;
    PFD_MAIN_PLANE = 0;
    PFD_OVERLAY_PLANE = 1;
    PFD_UNDERLAY_PLANE = LongWord(-1);
    MemoryDCs = [OBJ_MEMDC, OBJ_METADC, OBJ_ENHMETADC];
    var
    PFDescriptor: TPixelFormatDescriptor;
    PixelFormat: Integer;
    AType: DWORD;
    begin
    if LibHandle = 0 then
    InitOpenGL;

    FillChar(PFDescriptor, SizeOf(PFDescriptor), 0);

    with PFDescriptor do
    begin
    nSize := SizeOf(PFDescriptor);
    nVersion := 1;
    dwFlags := PFD_SUPPORT_OPENGL;

    AType := GetObjectType(DC);

    if AType = 0 then
    RaiseLastOSError;

    if AType in MemoryDCs then
    dwFlags := dwFlags or PFD_DRAW_TO_BITMAP
    else
    dwFlags := dwFlags or PFD_DRAW_TO_WINDOW;

    if opDoubleBuffered in Options then
    dwFlags := dwFlags or PFD_DOUBLEBUFFER;

    if opGDI in Options then
    dwFlags := dwFlags or PFD_SUPPORT_GDI;

    if opStereo in Options then
    dwFlags := dwFlags or PFD_STEREO;

    iPixelType := PFD_TYPE_RGBA;
    cColorBits := ColorBits;
    cDepthBits := zBits;
    cStencilBits := StencilBits;
    cAccumBits := AccumBits;
    cAuxBuffers := AuxBuffers;

    if Layer = 0 then
    iLayerType := PFD_MAIN_PLANE
    else
    if Layer > 0 then
    iLayerType := PFD_OVERLAY_PLANE
    else
    iLayerType := Byte(PFD_UNDERLAY_PLANE);
    end;

    PixelFormat := ChoosePixelFormat(DC, @PFDescriptor);

    if PixelFormat = 0 then
    RaiseLastOSError;

    if GetPixelFormat(DC) <> PixelFormat then
    if not SetPixelFormat(DC, PixelFormat, @PFDescriptor) then
    RaiseLastOSError;

    DescribePixelFormat(DC, PixelFormat, SizeOf(PFDescriptor), PFDescriptor);

    Result := wglCreateContext(DC);

    if Result = 0 then
    RaiseLastOSError
    else
    LastPixelFormat := 0;
    end;

    I am already tired, bed time... but this failing shit gets even more tiring
    **** !

    Bye,
    Skybuck.
     
    Skybuck Flying, Sep 24, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bun Mui
    Replies:
    0
    Views:
    3,496
    Bun Mui
    Jun 18, 2004
  2. PB
    Replies:
    1
    Views:
    594
  3. =?Utf-8?B?QXRhbnUgTWFoYXRh?=

    MOC code and Exam code

    =?Utf-8?B?QXRhbnUgTWFoYXRh?=, Dec 28, 2006, in forum: MCSE
    Replies:
    28
    Views:
    1,041
  4. =?Utf-8?B?R29sZCBFYWdsZQ==?=

    ntkrnlmp.exe error -- error code 4

    =?Utf-8?B?R29sZCBFYWdsZQ==?=, Oct 1, 2005, in forum: Windows 64bit
    Replies:
    4
    Views:
    4,518
    Charlie Russel - MVP
    Oct 2, 2005
  5. Mark Fuller
    Replies:
    1
    Views:
    679
    Mark Fuller
    Sep 10, 2010
Loading...

Share This Page