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 3 1 2 3

Search: Search took 0.01 seconds.

  1. How Can I Disable WM_CONTEXTMENU Handler of CEdit?

    Do I have create a new class inheriting CEdit?
  2. Re: CString::Format() Cannot Align Well Vertically

    Hello Friends,

    It's the font. After I changed the font to courier new, everything works.

    Thanks a lot for all the help.
    Brian
  3. Re: CString::Format() Cannot Align Well Vertically

    When I use printf(), there is no leading zero in the console output. I think the leading zero in the format string doesn't work since it is left justified.
  4. Re: CString::Format() Cannot Align Well Vertically

    I tried "%-07d%-20.3f%-07d%-20.3f%.3f\r\n" in GUI, and the problem is the same. The leading "0" doesn't make difference here.
  5. Re: CString::Format() Cannot Align Well Vertically

    In GUI, I use "\r\n" though.
  6. Re: CString::Format() Cannot Align Well Vertically

    Both give me the same result in GUI and console.
  7. Re: CString::Format() Cannot Align Well Vertically

    printf() works well.


    #include <stdio.h>

    int main()
    {

    printf("%-7s%-20s%-7s%-20s%s\n", "CalNo", "CalA (in)", "CalNo", "CalB (in)", "A+B (in)");
  8. CString::Format() Cannot Align Well Vertically

    Hi,

    I am trying to display some data in text format on a dialog and I am using a CString to do it. Below is how I coded it.



    CString outputStr;
    CString auxStr;

    // Add header
  9. Replies
    10
    Views
    343

    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...
  10. 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...
  11. Replies
    10
    Views
    343

    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? ...
  12. Replies
    10
    Views
    343

    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;
    ...
  13. 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...
  14. 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) +...
  15. Replies
    10
    Views
    343

    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...
  16. Replies
    10
    Views
    343

    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
  17. Replies
    10
    Views
    343

    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;
  18. Replies
    10
    Views
    343

    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...
  19. 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...
  20. 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...
  21. 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...
  22. 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.
  23. Re: How Do I Still Use Document/View Architecture for This Application?

    Thanks, it works.
  24. 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
    }
  25. 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.
Results 1 to 25 of 54
Page 1 of 3 1 2 3


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