Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: sunnysky

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    216

    Re: Problem in Displaying Bit Values

    Thanks OReubens,

    Let's say our image only have 256 distinct colors (actually only 64 colors in our application). To use 16/24/32bit display, we just specify 256 colors in the BITMAPINFO color...
  2. Re: Why is CreateDIBSection() Failing in My Code?

    Hi OReubens,

    According to Petzold's book, we can create a dib section without a DC as long as we use DIB_RGB_COLORS.

    I think biBitCount = 8 specifies maximum numbers of the image to be 256...
  3. Replies
    9
    Views
    216

    Re: Problem in Displaying Bit Values

    I still don't understand why the color table of BITMAPINFO need to be specified. We already have the palette. Aren't the values pointed by pvBits immediately mapped to a color in the palette? ...
  4. Replies
    9
    Views
    216

    Re: Problem in Displaying Bit Values

    I figured out. I missed the initialization of the color table implemented by the following code.


    WORD* color = (WORD*) pbmiDIB->bmiColors;

    for (int i=0; i<256; i++) {
    *(color++) = i;
    ...
  5. Re: Why is CreateDIBSection() Failing in My Code?

    Ok. I found the reason. It's the parameters for CreateDIBSection(). Since the first paramter is NULL, I should use DIB_RGB_COLORS for the third parameter. Otherwise, I should provide something...
  6. Why is CreateDIBSection() Failing in My Code?

    Hello, below is a block of my code. I don't understand why CreateDIBSection() returns NULL. Thanks a lot in advance.


    pPackedDib = (BITMAPINFO *)(malloc (sizeof(BITMAPINFOHEADER) +...
  7. Replies
    9
    Views
    216

    Re: Problem in Displaying Bit Values

    I am working on an old project that uses 256 color modes. I have been writing some small projects to reproduce its functionality in order to understand how it works.

    So, what have I missed in...
  8. Replies
    9
    Views
    216

    Re: Problem in Displaying Bit Values

    Hi OReubens,

    Thank you for these points.

    I have delete operation for pbmiDIB.

    delete pbmiDIB;
    pbmiDIB = NULL;
    But I may need to use
  9. Replies
    9
    Views
    216

    Re: Problem in Displaying Bit Values

    Another sample code using all purpose palette.



    void CColorDisplayView::OnDraw(CDC* pDC)
    {
    CColorDisplayDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
    return;
  10. Replies
    9
    Views
    216

    Problem in Displaying Bit Values

    I am writing a program to display values from a data file as an image. But I can only get a blue screen. Here is a small program resembling my code. Could you see what I have missed? I only...
  11. Re: How Do I Still Use Document/View Architecture for This Application?

    Thanks Victor. So this way still comply with the Document/View architecture. From MSDN, http://msdn.microsoft.com/en-us/library/ebc8c52a(v=vs.100).aspx I also found "Override this function if you...
  12. Re: How Do I Still Use Document/View Architecture for This Application?

    Hi Victor,

    When you handle text/binary files with CStdioFile/CFile, where do you usually put the file handlers? Do you override CWinApp::OnFileOpen() to handle ID_FILE_OPEN message? If so, where...
  13. Re: How Do I Still Use Document/View Architecture for This Application?

    Just out of curiosity. If we have a file format that are not supported by CArchive, for example a non-standard database file format that need third party access library, and we cannot use...
  14. Re: How Do I Still Use Document/View Architecture for This Application?

    Thanks. When I uncheck "Using Unicode Library" at the beginning of the wizard and it works too.
  15. Re: How Do I Still Use Document/View Architecture for This Application?

    Thanks, it works.
  16. Re: How Do I Still Use Document/View Architecture for This Application?

    I tried to use CStringA but got an error.



    void CCSVDisplayDoc::Serialize(CArchive& ar)
    {
    if (ar.IsStoring())
    {
    // TODO: add storing code here
    }
  17. Re: How Do I Still Use Document/View Architecture for This Application?

    I have problem using CArchive::ReadString. I have the same problem as the first link in my original post.
  18. How Do I Still Use Document/View Architecture for This Application?

    Hello,

    I am learning to use MFC to code a small project to read and display csv files. I can't use CArchive to correctly read line by line of a text file as pointed out in this post:...
  19. Does CreateDIBSection() Allocate Memory for *ppvBits?

    http://msdn.microsoft.com/en-us/library/windows/desktop/dd183494(v=vs.85).aspx

    The page above said "If hSection is NULL, the system allocates memory for the DIB." Is the allocated memory stored...
  20. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I also figured out how m_pDocument in each view is set.

    When creating views in CMainFrame::OnCreateClient(), CView::OnCreate() is called for each view to be created. In CView::OnCreate(), the...
  21. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I feel very grateful.
  22. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    I finally figured out what the problem is.

    The problem is the CTabView as Victor pointed out in post #9.

    My CSecondView class inherits CTabView. So I need to override OnInitialUpdate() like:
    ...
  23. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    That's what I want to find out. Why does it exist this time?


    Besides, how does m_pDocument get set in the two views that the wizard creates? I debugged in to the CSingleDocTemplate constructor...
  24. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    When a "Windows Explorer" application is created, the SetActiveView() function is successfully called in CFrameWnd::InitialUpdateFrame(). While I create splitter windows, SetActiveView() in...
  25. Re: Adding Splitter Windows Makes Mainframe Unable to Get Current Document

    So I was right in post 27, wasn't I?
Results 1 to 25 of 46
Page 1 of 2 1 2


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center