CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: SetPixel()

  1. #1
    Join Date
    Mar 1999
    Posts
    23

    SetPixel()



    Does anyone know why SetPixel and SetPixelV would fail if the return value of pDC>GetDeviceCaps(RASTERCAPS) contains the RC_BITBLT flag?


    Does the documentation not disclose other requirements for this function to work?



  2. #2
    Join Date
    Apr 1999
    Location
    Miami, FL
    Posts
    67

    Re: SetPixel()



    What does GetLastError() return?

  3. #3
    Join Date
    Mar 1999
    Posts
    23

    Re: SetPixel()



    Is this the correct use of the GetLastError() function?


    UINT32 error;


    if (!pDC->SetPixelV(iX, iY, RGB(0, 255, 0)))

    {

    error = GetLastError();

    }


    I got a return value of 0. I checked the GetLastError() table and this is what zero means:


    0 The operation completed successfully. ERROR_SUCCESS


    Any ideas?


    Thanks

  4. #4
    Join Date
    Apr 1999
    Location
    Miami, FL
    Posts
    67

    Re: SetPixel()



    It looks like you're calling it correctly, assuming that "UINT32" is equivalent to DWORD.


    According to the docs, if SetPixelV fails GetLastError will give you the error, but only if you're running on Windows NT. Are running on NT?



  5. #5
    Join Date
    Mar 1999
    Posts
    23

    Re: SetPixel()



    No, I've got Win98.


    I think I found a problem which is causing all my minor ones. These problems all have to do with printing documents. I've just discovered that the printing process and the screen drawing process can occur at the same time on different threads. Since both sets of functions first initialize a set of common variables, this isn't a good thing to have happen!


    For example, both initialize a structure to contain the horz and vert resolution. My document is many pages in length. Sometimes between pages, that structure would suddenly change it's value!


    Things seem to be working a lot better now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured